Write a program to illustrate array with strings, C/C++ Programming

Assignment Help:

Write a Program to illustrate Array with Strings?

main()
{
static char name[]="devdas";
int i;
i=0;
while(name[i]!='\0')
{
printf("%c",name[i]);
i=i+1;
}
}

In the 'name' array and the zero th character is'd', the first one is 'e' etc. The loop confirms for the null character to find if the character array is terminated. When it finds one then it jumps out of the loop. The program doesn't rely ahead the length of the string instead it looks for the null character to check whether the array has ended.


Related Discussions:- Write a program to illustrate array with strings

Insert values in queue - c++ program, Insert values in queue - C++ program:...

Insert values in queue - C++ program: Write a program to insert values in queue. int main()   {         int k;     Queue timeLine;     cout     for(

Lowest cost entry, code for solving optimal solution for matrix

code for solving optimal solution for matrix

Should i employ null or 0?, A: In C++, the definition of NULL is 0, thus th...

A: In C++, the definition of NULL is 0, thus there is only an aesthetic difference. I prefer to ignore macros, so I employ 0. Another difficulty with NULL is that people sometimes

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd