Now most of this code is just for clarification this is not what I am actually attempting to do. I want to pass a string without having to declare it first with something like. string = "This is a string"; and then call foo( string );
I want to be able to pass a string using only one line of code. Secondly, I want to be able to step through the string one character at a time.
I know I can do something like this
Code:
void foo( char string ) { // code }
Although the problem with that is it calls that function for each individual character and doesn't include the terminating character '\0'.
Any ideas?
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
Posted: Fri Feb 04, 2011 10:23 am
Look at the thread immediately in front of this one 'Passing a const string'.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum