Preserved Topic: Java / C comparison (copy problem) |
|
---|---|
Author | Thread |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 09-27-2002 23:13
In Java I could have a chunk of code as follows: code: char charArrayp[] = new char[20];
code: char charArray[20];
code: char stringCopy(char toCopy);
code: char stringCopy = stringCopy(stringArray);
|
Paranoid (IV) Inmate From: A graveyard of dreams |
posted 09-28-2002 00:19
[edit] it didn't work as it was supposed to I'll repost it as soon as I find out what is wrong with it [/edit] |
Maniac (V) Mad Scientist From: 127 Halcyon Road, Marenia, Atlantis |
posted 09-28-2002 15:02
what are you trying to do, make a header or library or something? |
Paranoid (IV) Inmate From: Madison, Indiana, USA |
posted 09-29-2002 22:35
To do what you want to do in C: code: char stringCopy = stringCopy(stringArray);
code: char * stringCopy(char * string)
|
Paranoid (IV) Inmate From: Madison, Indiana, USA |
posted 09-29-2002 22:40
I forgot to mention that the reason you can do the following in Java: code: newString = stringCopy(string)
|
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 10-01-2002 15:20 |