Raised This Month: $ Target: $400
 0% 

#define string in string


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 01-30-2010 , 16:57   Re: #define string in string
Reply With Quote #19

Quote:
Originally Posted by Greyscale View Post
Actually yes it is, but without the [0] the compiler errors. And oddly it's returning a random letter, not a the first letter of the string.
What errors?

PHP Code:
public OnPluginStart() {
    
decl String:str[32];
    
str SomeFunc();
    
PrintToServer("Text: %s",str);
}

String:SomeFunc() {
    new 
String:mystr[32] = "oh hai there";
    return 
mystr;

This compiles just fine. And runs nicely too.
Also, the compiler throws an error if str[] is too small to hold the return value. Interesting.

EDIT: at least when the array size is 28 or lower... weird.
__________________
plop

Last edited by p3tsin; 01-30-2010 at 17:01.
p3tsin is offline
 



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 22:05.


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