Go Back   EQEmulator Home > EQEmulator Forums > General > General::General Discussion

General::General Discussion General discussion about EverQuest(tm), EQEMu, and related topics.
Do not post support topics here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-19-2012, 12:49 AM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default Array Question

I'm working on reducing some redundant code segments and ran across something that I'm curious about.


In my mod, I have 5 elements and initialize my array as <type> myarray[5] = {arg1, arg2, arg3, arg4, arg5}.

I reference it using a zero-based index and everything works just fine.


However, I ran across this snippet and can't figure out why it's coded this way.

Code:
const char *message_arg[9] = {0};

<...>

i = 0;
message_arg[i++] = message1;
message_arg[i++] = message2;
message_arg[i++] = message3;
message_arg[i++] = message4;
message_arg[i++] = message5;
message_arg[i++] = message6;
message_arg[i++] = message7;
message_arg[i++] = message8;
message_arg[i++] = message9;
Does this method assign the first value at index [0] or [1]? (If [1], will adding the string value to message_arg[9] throw an exception, or am I missing something?)

Each message# is passed as a parameter into the function.


Thanks!
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:07 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3