what is difference between array of characters and string

Answer Posted / zubair

String is much same as character array, it can also be
checked by each characters:
string str;for(int i=0;str[i]!='\0';i++) cout <<str[i]<<endl;

1. The NULL terminator is loaded automatically in string.('\0')
2.Both of them drop the data after space when we take input.

Is This Answer Correct ?    35 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a spanning Tree?

947


What is volatile variable in c with example?

581


Define C in your own Language.

635


How many parameters should a function have?

661


Is exit(status) truly equivalent to returning the same status from main?

583






Explain what is the benefit of using an enum rather than a #define constant?

714


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15044


What is assert and when would I use it?

573


What is difference between structure and union with example?

590


Difference between MAC vs. IP Addressing

635


what is a constant pointer in C

674


What are the features of the c language?

640


Explain what is the general form of a c program?

619


How can I swap two values without using a temporary?

610


What is the scope of global variable in c?

551