2008-1-15
1. Basic Structure
Int main (INT argc, char * agrv [])
2. Basic Input and Output
Include <iostream>
Using namespace STD;
Cin>
Cout <
3. Loop Input and Output
While (! Cin. EOF ())
4. Structure Problems
If you want to call other functions in main,
Method 1: Write the function in front
Method 2: declare the function before the main function
5 shift problems
A <1; does not change the value of.
**************************************** *****
2008-1-16
1 int to string
# Include <sstream>
Stringstream SS;
SS <num;
Const char * cstring = ss. STR (). c_str ();
2. Define the array type
Typedef int sheet [2] [2];
Sheet;
A [0] [1] = 10;
***************************
2008-1-17
1 string
String can be summarized and used
Getline (CIN, string)
String: Find ()
String: substr ()
String: c_str ()
String: length ()
Char * STR = new char [N]
Cin> STR;
New
***************************************
1. Enum
{, //, Separated by numbers
// The last one is not added,
}
**************************************** ***
2008-1-21
1. When the pointer encounters an array
Use a pointer to point to an element in the array.
Int A [3] = {1, 2, 3 };
Int * temp = a + 2;
Point the pointer to an element in the array as a parameter.
Int * temp;
Fun (temp );
Void fun (int * & I) {I = a + length ;}
* & Sequence cannot be changed
Class 2 is over ";"
**************************************** ******
2008-1-22
1 encounter pointer Array
Mylink ** link;
Link = new mylink [10]; // Error
Link = new mylink * [10]; // correct
**************************************** *********
1 error c2236: Unexpected "class "...
After Enum, there are fewer semicolons.
**************************************** ***********
2008-7-25
Struct Structure
Defines a struct structure.
Struct _ Structure {int index; char * STR} structure;
There is a linked list array,
Structure *;
First, allocate the specified length of things,
A = malloc (sizeof (structure) * n );
Then you can use it directly?
A [0]. Index = 1;
A [0]. Str
Pointer to pointer
Int ** PTR;
PTR = (INT **) malloc (sizeof (int *) * 10 );