+ 1

assignment to astructure in C

I read in a book that it is possible to assign information from one structure to another directly with an assignment statement but the example shown causes error. i think it should be y = x; I enclose the example code you can confirm thanks https://code.sololearn.com/c8QnlwE6lQ80/?ref=app

11th Jan 2022, 4:34 PM
Makko kola
Makko kola - avatar
7 Answers
+ 2
Yes I changed line 9 to y = x; and it worked, so I think it's fine.
11th Jan 2022, 4:46 PM
Ipang
+ 2
Not a problem šŸ‘Œ
11th Jan 2022, 4:47 PM
Ipang
+ 1
Is line 9 correct as per that book's example?
11th Jan 2022, 4:40 PM
Ipang
+ 1
thanks
11th Jan 2022, 4:47 PM
Makko kola
Makko kola - avatar
+ 1
"Yes I changed line 9 to y = x; and it worked, so I think it's fine" @Ipaang I also tried that and it worked.
11th Jan 2022, 4:49 PM
Rellot's screwdriver
Rellot's screwdriver - avatar
0
no, that's just the wrong one
11th Jan 2022, 4:42 PM
Makko kola
Makko kola - avatar
0
putting y = x correctly gives 10. i wanted to know if y = x is right
11th Jan 2022, 4:44 PM
Makko kola
Makko kola - avatar