String bug

Non-platform specific questions.

String bug

Postby DilloDude » Sun May 07, 2006 11:51 am

This is an odd bug: if you are entering a string in the script editor (char *str), and it is not a parameter in a function, it assigns the string to be empty-just a null. Then you cannot put anything into that string, or you get errors. There are two was to fix this:
  1. Array String: create it as an array string (char str[20])
  2. Assign text to it: assign text at its creation: char *str = "ADDSOMETHINHERESOTHEREISSPACEFORALONGSTRING";
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: String bug

Postby makslane » Sun May 07, 2006 12:15 pm

DilloDude wrote:This is an odd bug: if you are entering a string in the script editor (char *str), and it is not a parameter in a function, it assigns the string to be empty-just a null.


Can you show me a code?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest