C language stores multiple strings in an array of characters, how to store them, for example

Updated on technology 2024-08-06
5 answers
  1. Anonymous users2024-02-15

    #include

    char a[80];

    will"abcd"Save to A.

    strcpy(a,"abcd");

    Output a string in a.

    puts(a);

    will"1234"Save to A.

    strcpy(a,"1234);

    Output a string in a.

    puts(a);

  2. Anonymous users2024-02-14

    #include

    using namespace std;

    int main()

    char a[80];

    strcpy(a,"abcd");First, assign ABCD to the array acout

  3. Anonymous users2024-02-13

    The materials that need to be prepared are: computer and C language compiler.

    1. First of all, open the C language compiler and create a new initial. CPP file, for example:

    2. In the file, enter C language**:

    char a[10][100];

    for (int i = 0; i < 10; i++)gets(a[i]);

    3. The compiler runs the file, and at this time, an array of 10 strings is successfully defined, and the input is made one by one.

  4. Anonymous users2024-02-12

    Summary. In C++, you can use loops to store an array of characters in groups of two characters into another array. First, we need to define two arrays, one to store the original character array, and the other to store the results of a set of two characters.

    Assuming the original character array is charoriginalarray and the length is n, then the length of the resulting array should be n 2. We can use a loop to iterate through the original array and store every two characters into the resulting array. An example is as follows:

    cpp#includeintmain(){charoriginalarray=abcdefgh";intn=sizeof(originalarray)-1;Subtract one to remove the closing sign of the string'\0'charresultarray[n/2];for(inti=0;i

    How C++ stores an array of characters in two bytes into another array.

    In C++, you can use loops to store an array of characters in groups of two characters into another array. First of all, we need to define two arrays, one to store the original character array, and the other to store the results of a group of two characters. Assuming the original character array is charoriginalarray and the length is n, then the length of the resulting array should be n 2.

    We can use a loop to iterate through the original array and store every two characters into the resulting array. Example** is as follows: cpp includeintmain(){charoriginalarray=abcdefgh.}";intn=sizeof(originalarray)-1;Subtract one to remove the closing sign of the string'\0'charresultarray[n/2];for(inti=0;i

    Excuse me, but please go into more detail?

    In C++, you can use loops to store an array of characters in groups of two characters into another array. The original character array is a state-slippery abcdefgh, and after processing, the resulting array will contain aceg. Lu closed stove.

  5. Anonymous users2024-02-11

    This requires defining two arrays, one of int and one of char.

Related questions
14 answers2024-08-06

1. Use Chinese as identifier, the premise is that the compiler supports Chinese as identifier, after C++11, the universal character name covers Chinese characters. >>>More

17 answers2024-08-06

Let's talk about the idea first:

Get the last one within this string. location, which is the index. >>>More

9 answers2024-08-06

Hello, I'm glad you questioned. Take a look below:

is an escape character that represents one (1). >>>More

10 answers2024-08-06

The meaning of the title is said upstairs.,Here's a **.。 >>>More

16 answers2024-08-06

stuff deletes characters of the specified length and inserts another set of characters at the specified starting point. >>>More