Lecture 49
Array
// String Array
#include <iostream>
#include <conio.h>
using namespace std;
main ()
{
char
name[10]={"Shahid"};
//declaration
cout<<"My name : \n"
<<name[0]<<"\n"
<<name[1]<<"\n"
<<name[2]<<"\n"
<<name[3]<<"\n"
<<name[4]<<"\n"
<<name[5]<<"\n";
getch();
return 0;
}
Code view in dev compiler:
Compile the program Ctrl+F9
Run program Ctrl+F10