Below code returns an error b does not name a type. why ?? Is variable assignment not allowed in classes like general assignment | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Below code returns an error b does not name a type. why ?? Is variable assignment not allowed in classes like general assignment

class x { private: int a; public: int b,c; b=c; };

7th Oct 2016, 12:31 AM
sai chaitanya nandipati
2 Answers
+ 1
It is because you are trying to use c without defining it. Here you have declared c but it also needs to be defined to be used.
13th Oct 2016, 11:17 AM
Shivam Kumar Meena
Shivam Kumar Meena - avatar
0
hy
29th Aug 2017, 6:26 PM
REHAN CINTA ROSULULLAH REHAN CINTA RASULULLAH
REHAN CINTA ROSULULLAH REHAN CINTA RASULULLAH - avatar