Jason2gs
2008-04-05 18:44:58
Oh, and strings!
Yes. I'm quite confused about all the different char data types in C++.
I'm also trying to figure out (through trial-and-error, mostly) how to use strings and chars at the same time. Er… That doesn't really make sense, does it?
Line four messes up, and spits:
Out into the terminal.
I'm sure I'm messing something up here. I just don't know what.
Could someone lend a hand?
And regarding the subject line…
What do all the asterisks in different places do? And why can't you initialize a char *var like this?:
Thanks for reading. Please see what you can do,
-Mike
Yes. I'm quite confused about all the different char data types in C++.
I'm also trying to figure out (through trial-and-error, mostly) how to use strings and chars at the same time. Er… That doesn't really make sense, does it?
string temp = "POST /ResultEJ.aspx HTTP/1.1\r\n";
temp += "Host: www.englishjapaneseonlinedictionary.com\r\n";
temp += "Content-Type: application/x-www-form-urlencoded\r\n";
temp += "Content-Length: "; temp.append((const char*)strlen(argv[0])); temp += "\r\n\r\n";
temp += "search="; temp.append(argv[0]); temp += "\r\n";Line four messes up, and spits:
Segmentation fault (core dumped)
Out into the terminal.
I'm sure I'm messing something up here. I just don't know what.
Could someone lend a hand?
And regarding the subject line…
What do all the asterisks in different places do? And why can't you initialize a char *var like this?:
char *msg = "Hewwo!" + "Goodbye!";Thanks for reading. Please see what you can do,
-Mike