Lecture 50
Array
// String Array
#include <iostream>
#include <conio.h>
using namespace std;
main ()
{
char
name[10]={'S','h','a','h','i','d','\0'};
//declaration
char
name1[10]; //declaration
name1[0]='I';
name1[1]='q';
name1[2]='b';
name1[3]='a';
name1[4]='l';
name1[5]='\0';
cout<<"My name : "<<name<<"
"<<name1;
getch();
return 0;
}
Code view in dev compiler:
Compile the program Ctrl+F9
Run program Ctrl+F10