954,123 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

converting from string to char*

I want to find the length of a string, But the strlen function seems only to work with chars. I can't use a char[] to store my text because the size must be known beforehand and I don't know it. So I read everything into a string, then tried to convert it to a char like this.

string count;
char* count1=(char*(count));


This gives an error that expects a comma or semi-colon before 'char'..
How can I convert from string to char*? and if there is no way to do this, can anyone think of another way of counting the no. of characters in a trie structure aside from reading everything into a string and getting the length of it as I am trying to do?

taineechan
Newbie Poster
17 posts since Oct 2006
Reputation Points: 10
Solved Threads: 1
 
WolfPack
Postaholic
Moderator
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
 

thanks...it works now:)

taineechan
Newbie Poster
17 posts since Oct 2006
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You