void Cout(char* str)
{
cout<<str;
}
Is it bossible to pass string as param to this func?
Hi, if I have string can I anyway pass it to that function below?
I tryed using c_str() but obiously that doesn''t work.
Please don''t say use char, the problems this.
quote:Original post by DerekSaw
How about:void Cout(const char *str) { cout << str; }
Ah! so simble (what was I thinking?) Thanks man!
quote:Original post by Craazer
Ah! so simble (what was I thinking?) Thanks man!
Is the 'P' letter missing in your keyboard?
And for your question, yes you can.
[edited by - xaxa on March 25, 2003 4:24:50 AM]
quote:Original post by Anonymous Poster
or better yet
Cout((char*)string.c_str());
c_str() already returns a char*, why would you want to cast it?
no, it returns a const "char*". don''t cast the const away unless you really have to and know it is safe in the expression you use it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement