answersLogoWhite

0

There is no difference. A string is just an array of type char. The only real difference is that we do not need to keep track of the length of a string because strings are null-terminated in C. If a string does not have a null-terminator, then it is just an ordinary array of character values.

User Avatar

Wiki User

9y ago

What else can I help you with?

Related Questions

What is the Difference between arrays in c and c plus plus?

Nothing whatsoever. They are exactly the same.


What are Strings in C programming?

Arrays of chars are strings. there is a built in librray, that handles string string.h but the data-type is held as arrays of chars. char[10] c="string"; translate to ['s','t','r','i','n','g',\0] Arrays of chars are strings. there is a built in librray, that handles string string.h but the data-type is held as arrays of chars. char[10] c="string"; translate to ['s','t','r','i','n','g',\0]


How can you do the same thing as the program below but using strings and arrays in C language?

Program below?!


What is type string in C?

Nothing, zero-terminated char-arrays are used instead of strings.


What is the main difference between the violin and viola?

A viola has the (left to right) C,G,D,A strings and the violin has G,D,A,E strings


What is the main difference between a violin and viola?

A viola has the (left to right) C,G,D,A strings and the violin has G,D,A,E strings


How do you print my name in c program in vertical manner using arrays?

you need strings to print any character(your name) this is not possible useing array:D


What is the difference between forward slash and backward slash in c?

forward slash - division operator backward slash - special character (e.g. \n - newline) in C strings


How do you swap two arrays in c plus plus using string?

You can't. While a string is a character array, an array is not necessarily a string. Treating arrays as if they were strings simply to swap them is madness. The correct way to physically swap arrays A and B is to copy A to a new array, C, then copy B to A, then C to B. If the arrays are the same size this is not a problem. If they are different sizes, you can only swap them if they are dynamic (not static). This means you must reallocate them. To speed up the process, copy the smallest array to C, first. A much better approach would be to point at the two arrays and swap the pointers instead.


What is the required syntax for creating C arrays?

The required syntax for creating C arrays include the brackets, array size, variety length arrays, codes like std:vector, classPTR, and many more to create C arrays.


What are the differences between the drop C tuning and the standard C tuning for guitar?

The main difference between drop C tuning and standard C tuning for guitar is that in drop C tuning, the lowest string is tuned down two semitones to a C note, while the rest of the strings remain in standard tuning. This allows for heavier and deeper sounds compared to standard C tuning, where all strings are tuned to standard notes.


What are the differences between structures and arrays?

Arrays are collections of repeated data items. Structures are complex data items made up of other data items, including, potentially, other structures and arrays. You can, of course, also have arrays of structures. Array items can be accessed by using its subscript whereas structure items can be accessed using its dot or "arrow" operator in C, C++, C#, Java, and JavaScript.