C++ examples for Data Type:char array
Displays a string with pointer notation
#include <iostream> using namespace std; int main()//from w w w . j a va 2 s . co m { void dispstr(char*); //prototype char str[] = "this is a test test."; dispstr(str); //display the string return 0; } void dispstr(char* ps) { while( *ps ) //until null character, cout << *ps++; //print characters cout << endl; }