A
A
Alexander Rybakov2018-11-01 19:31:27
C++ / C#
Alexander Rybakov, 2018-11-01 19:31:27

Why is the strcpy function not working?

There is an array of structural variables

struct EDB{
    char *firstName[6];
    char *secondName[6];
    int age;
    int weight;
} A[20];

Is there a processing
strcpy(A[i+1].firstName, A[i].firstName);
                strcpy(A[i+1].secondName, A[i].secondName);
                A[i].age = A[i+1].age;
                A[i].weight = A[i+1].weight;

The numbers are thrown, but the lines are not.
Shaw delacs?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2018-11-01
@turkish777

strcpy(A[i+1].firstName, A[i].firstName);
...
A[i].age = A[i+1].age;

the essence of this particular piece of the task is deleting a line with data (I do it by reassigning to the next line and reducing the number of lines by one)
strcpy copies the second argument to the first as an assignment operator.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question