finding characters in a char variable?

how would I search a CHAR variable for a certain series of letters and return the position of these letters, also if possible,how would I then truncate this and convert it to a double?
I'm using visual studio 2008 and making a console program.

I've tried using strings, but std::cin refuses to accept them and std::cout refuses to display them, i've looked at converting chars to strings and vice versa and found this:
1
2
3
4
5
6
7
#include <sstream>
#include <string>
stringstream ss;
string s;
char c = 'a';
ss << c;
ss >> s;

( http://www.cplusplus.com/forum/beginner/4967/ )
but VS is throwing up errors about s and ss not being initialized.
anything more useful would be of great help.
Last edited on
string should work with cout and cin? what code did you use? and also the code you posted compiles fine for me and i used visual studio 2003
I restarted VS and it now works fine, I thought it should do, but it kept throwing up errors about it overloading and cannot find >> operator for string type class etc. anyway, thanks =)
Topic archived. No new replies allowed.