Hello! I'm trying to learn C++ by having my friend in class send me his homework and me just doing it on my own, I've been able to keep up until now, I have no idea how to do this:
I know what a structure/class is, I know arrays, but I just don't understand what the assignment wants me to do, it's written in such a complicated way.
I'm not asking for the solution, just some guidance on where to even begin, or some hints on how to solve it.
You need a semi-colon at the end of line 10. But you also have only allocated an array of size 3, yet you are trying to give it 4 elements. Replace the 3 with a 4.
Is that so? I thought arrays were counted from 0, so 4 elements means it should be 3?
Adding the semicolon did not fix the error. I thought they all had to end with a comma?
I know how to use functions and declare arrays, I just don't understand what the assignment wants me to do,
and 2) how I can pass an array of the Seat Structure to a function? It's obviously not the same way as passing a regular array of like ints or something.
$ cat ascii.cpp
#include <iostream>
using std::cout;
int main(){
int iY=0, val=0;
char test;
test = (char)iY+17;
val = test;
cout << test << "\n" << val;
}
It just produces "17" as output, which is a ctrl-q.
You've asked it to use a char datatype, but that doesn't make a VALUE of zero into a value of "0". It makes an int with a value of zero into a NUL.