works just fine... But I want to make my own string functions...
Code:
void MyStringFunc(string s){ // instead of string, i could use type char *s[]
// do something with strign here
}
main(){
MyStringFunc("Hello world");
}
But that doesn't work. I get errors about cannot make a pointer to a constant. How come you can pass a constant "hello world" to printf but not to my own function? How can I define a function to accept a "string" in the function call?
Thanks,
Sal
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
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