S
SteelSide
Ive searched and searched,but havent been able to get it to work.
-----------------
#include <iostream>
using namespace std;
std::string tempHostNameStr = "s1e2.hidden.thingy.org";
char szHostName[128];
for(int i=0; i < std::string tempHostNameStr.size(); i++){
szHostName = tempHostNameStr;}
Errors:
C:\Documents and Settings\Daniel\Mina dokument\c++\stringtest.cpp:13:
error: expected unqualified-id before "for"
C:\Documents and Settings\Daniel\Mina dokument\c++\stringtest.cpp:13:
error: expected `,' or `;' before "for"
C:\Documents and Settings\Daniel\Mina dokument\c++\stringtest.cpp:13:
error: expected constructor, destructor, or type conversion before '<'
token
C:\Documents and Settings\Daniel\Mina dokument\c++\stringtest.cpp:13:
error: expected `,' or `;' before '<' token
C:\Documents and Settings\Daniel\Mina dokument\c++\stringtest.cpp:13:
error: expected constructor, destructor, or type conversion before '++'
token
C:\Documents and Settings\Daniel\Mina dokument\c++\stringtest.cpp:13:
error: expected `,' or `;' before '++' token
Execution terminated
-----------------
#include <iostream>
using namespace std;
std::string tempHostNameStr = "s1e2.hidden.thingy.org";
char szHostName[128];
for(int i=0; i < std::string tempHostNameStr.size(); i++){
szHostName = tempHostNameStr;}
Errors:
C:\Documents and Settings\Daniel\Mina dokument\c++\stringtest.cpp:13:
error: expected unqualified-id before "for"
C:\Documents and Settings\Daniel\Mina dokument\c++\stringtest.cpp:13:
error: expected `,' or `;' before "for"
C:\Documents and Settings\Daniel\Mina dokument\c++\stringtest.cpp:13:
error: expected constructor, destructor, or type conversion before '<'
token
C:\Documents and Settings\Daniel\Mina dokument\c++\stringtest.cpp:13:
error: expected `,' or `;' before '<' token
C:\Documents and Settings\Daniel\Mina dokument\c++\stringtest.cpp:13:
error: expected constructor, destructor, or type conversion before '++'
token
C:\Documents and Settings\Daniel\Mina dokument\c++\stringtest.cpp:13:
error: expected `,' or `;' before '++' token
Execution terminated