#include
#include
using namespace std;
int main()
{
//Some string here
string number = "123456789";
//Array to hold the separate integers
int intArray[ number.length() ];
//Convert from char to int
for ( int i=0; i < i="0;">
[note] convert char to int in a string
11:01 AM at 11:01 AMPosted in Notes | 0 comments »
[note] read file data to string, by char
11:00 AM at 11:00 AM#include
#include
using namespace std;
int main()
{
ifstream inputFile;
inputFile.open("some file name here");
string number;
char digit;
while( inputFile.get( digit ) )
{
number = number + digit;
}
return 0;
}
Posted in Notes | 0 comments »
[note] pointer class function
10:55 AM at 10:55 AMclass myclass
{
node IPlist::*find (string address) const;
}
//the notation should be :
node* IPlist::find (string address) const
{
...
}
Posted in Notes | 0 comments »
[note] Compare string
10:50 AM at 10:50 AM//string can be compared directly, even it has "." or "@" symbols inside
#include
int main()
{
std::string a;
std::string b;
if ( a == b )
{
cout << "a is equal to b"; } }
Posted in Notes | 0 comments »
C++ Forum
10:31 AM at 10:31 AMI found a very good c++ forum, http://www.codeguru.com/forum/ in there, peoples gave me very fast and professional replys.
Posted in Notes | 0 comments »