Arrays SETTER & GETTER

273 views
Skip to first unread message

Andres Com

unread,
May 21, 2024, 12:47:21 PM5/21/24
to C++ GCU Forum
Captura de pantalla 2024-05-21 113417.pngCaptura de pantalla 2024-05-21 114006.pngCaptura de pantalla 2024-05-21 114036.pngCaptura de pantalla 2024-05-21 114050.pngCaptura de pantalla 2024-05-21 114140.png

zoso

unread,
May 23, 2024, 3:00:55 PM5/23/24
to C++ GCU Forum
Your line in the setter is not doing what you think it is doing.

It's just reassigning the member variable pro to itself which is why whatever you are setting is not reflecting during printing. Change the name of the input argument of setPro to something other than pro and you should hit into errors. You can't assign int* to int[30]. Look up std::array and use that.

Andres Com

unread,
May 24, 2024, 12:10:39 PM5/24/24
to C++ GCU Forum
Thank you so much...1.png2.png5.png
Reply all
Reply to author
Forward
0 new messages