Raised This Month: $ Target: $400
 0% 

Equal and sizeof.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-10-2011 , 03:43   Re: Equal and sizeof.
Reply With Quote #1

Quote:
Originally Posted by fysiks View Post
  1. For the error in question: Look at the line below it where you use it correctly.
  2. You have too many parentheses on that line.
  3. You shouldn't use sizeof() for that parameter anyways. You should use strlen() if you insist on using anything at all there.
  4. If you ever need sizeof(string)-1 you should use charsmax(string) instead to make it less confusing for you since charsmax is defined as sizeof minus 1.
also if you didnt notice in the code the format needs a higher length because it has to hold weapon_m4a1 and so forth... 7 only holds weapon_.

As for your variable 'x' i would use something like weaponName it helps with readability.

My code has been updated with the suggestion.
Doc-Holiday is offline
Reply



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 03:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode