Hello everyone, I want to read my shape, and also the inheritance rectangle from a text file. I got an error : id returned 1 exit status. I'm still learning about classes which i think I did wrong in my int main for rectangle. Is there anything i should change?
source.txt
6 25
4 7
PSA: 6 25 is for my shape and 4 7 is for my rectangle
I could be wrong but it looks to me like shape's constructor does not actually set x and y, leaving them as random values. This is not your crash problem, though.
you don't seem to draw the rectangle either, in the read file loop.
add this
cout << count++ << endl; in your while loop at the top of it
cout.flush();
also you read from the file weird.
it says this:
while (read height & length)
draw the shape of height/length
do nothing with the rectangle of height/length
loop again...
it should say this
while(…)
do shape stuff
read height and length again
do rectangle (including missing draw) stuff
before the error : id returned 1 exit status, there is undefined reference Rectangle :: Rectangle (). before i put the value as a text file, it can run, but when i start to read from text file. it shows the error