// The C Programming Language Job 5.9.1 // Write a declaration: The pointer to the character contains 10 integers, including 10 integer arrays, pointers, pointers to the character string, to characters pointers Pointer, constant integer, constant integer / / pointer to integers constant pointers.
#include
Void main () {char * a = "i love bb !!"; cout << a << endl; int b [10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; for (int i = 0; i <10; i ) cout << b [i] << ""; cout << Endl; int * c = b; for (i = 0; i <10; i ) ) cout << * c << ""; cout << endl; char d [] = "i love bb !!"; char * e = d; for (i = 0; * e! = 0; i ) cout << * E ; cout << Endl; char ** f = & a; // and int ** a bit different cout << * f << endl; char *** g = & f; cout << ** g < #include // 到 整 整 INT * C = new int (123); cout << * c << endl; // to the pointer of the character of the pointer Char * d = "hahaha"; char ** E = & d; cout < / / To the pointer INT ** H = g of the array containing 7 intenses; for (i = 0; i <7; i ) cout << * h << Endl; // Displays pointers in each element Address // can also be used with cout << h [i] << endl; h- = 7; // restore pointer address for (i = 0; i <7; i ) cout << ** h << Endl; / / Display the value of the object referring to the pointer in each element / / Contains an array of 8 arrays, each array contains 7 pointers INT ** J [8] = {G, G, G, G, G, G, G, G}; int K = 0; For (i = 0; i <8; i ) {cout << "j [" << i << ":"; for (k = 0; k <7; k ) cout << * j [i] [K] << "; cout << Endl;} // If an array element is an array, that is, the element of this array is the first address of another array, // is a pointer, then this array is also a The pointer, the J is a pointer to the / / pointer to 8 arrays. } // The C Programming Language Job 5.9.4 // Write a function, it swaps two integers (exchange their values). Work with int *. Write // Another exchange function, use int & to work. #include #include // CHAR range is -128 to 127, and the implicit conversion is performed, and the compiler will warn, such as 3300. // 1, with char as a function of the function: // can accept CHAR, INT, const int, signed char, unsigned char, etc. // because the incoming argument is only used in the function body, does not affect the function Actual variables are accepted. // 2, with char & as a function gate: // can only accept CHAR types. // Because the incoming argument is a reference external variable, an external value is indirectly modified, and there are some unsafe // implicit conversions, so the types of CHAR are not accepted. // 3, with the const char & functional number: // can accept CHAR, INT, const int, signed char, unsigned char, etc. // mainly because it is const, so it will not modify the arguments in the function body, so accept. // The C Programming Language Job 5.9.10 // Defines an array of strings, where the string saves the name of the month. Print these strings // passed these strings to a function and printed. #include / / Pass the array of strings, the type of pointer CHAR pointer // the C Programming Language job 5.9.11: // From the input read a series of words, use QUIT as the end of the input. These words are printed in the order of reading, / / but the same word should not print twice, and the word is sorted before printing. // Made with char, one word, annoyance ..... # include } // Remove the re-generating new array String CZB [100]; CZBB [0] = CXBB [0]; INT K = 1, i = 1, j = 0; for (i = 0; i // Define a struct date to save the date of the date. Provide some functions, write Date from entering Date, output Date to //, and initialize DATE with a date;