V
V
Vlad_beg2017-05-20 16:44:33
PHP
Vlad_beg, 2017-05-20 16:44:33

How to correctly copy the value of one structure to another?

There are two structures Login and CoWorker. You need to copy the co_name value to the username of the login structure

struct CoWorker {
  char co_name[90];
  double co_salary;
};

struct Login {
  char username[90];
  char password[90];
};

strcpy(login_struct[i].username, co_worker[i].co_name);

Tried to copy values ​​using strcpy but throws an error
expression must have pointer-to-object or handle-to-C++/CLI-array type

I use c++/cli

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladimir Proskurin, 2018-08-10
@Vlad_IT

You obviously need to understand how interest is calculated. If you need to calculate the percentage of $win[1] from $win[2], then you need to write
$percent = $win[1] / ($win[2] / 100)

V
Vlad_beg, 2017-05-21
@Vlad_beg

The error was in another, in the function of reading the file

J
John_Nash, 2017-05-20
@John_Nash

the error is clearly not here, tk. the above code has nothing to do with cli

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question