answersLogoWhite

0


Best Answer

There is no data type string in C. String is handled as an array of characters. To identify the end of the string, a null character is put. This is called a null terminated character array. So array of strings will be a double dimensioned array of chars. It is implemented as an array of pointers, each pointer pointing to an array of chars.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

Strings belong in a resource file, from where they can be loaded and unloaded as and when they are actually required. In multi-language programs, strings are often placed in separate resource files (one per language), such that only the currently selected language resource is loaded at runtime. However, critical strings relating to those resources (e.g., missing resource errors), need to be placed in the program itself, but should ideally be scoped to the function(s) that actually require them.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Where string arrays belong in a C program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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]


Where do you use arrays?

Anywhere you want a collection of like typed items arranged in a sequential list. A character string is an example of an array of char.Do not confuse this with C++ string classes. I am talking about plain old-fashioned C strings, such as argv[0], which points to the name of the program.


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 type string in C?

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


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

Program below?!


Do you have pointer concept in c plus plus language?

Yes. All string variables are pointers as are other arrays.


What is the use of Reverse String in C program?

The use of the reverse string in C program is used to reverse the letters in the string. An example would be reverse me would be reversed to em esrever.


C plus plus program that display student name course and grade using arrays of strings?

enum field { name, course, grade }; std::string student[3]; student[name] = "Joe Bloggs"; student[course] = "C++ Programming"; student[grade] = "A+";


Why and operator can not be used in string of c program?

Any character can be used in string, except for \\0. char example [] = "A&B|C";


C program plus copy of string to another?

strcpy


C plus plus program to perform string manipulation?

You do not need to program string manipulation as it is already part of the standard library. See std::string and std::wstring.


What is the difference between Strings and Arrays in c?

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.