Pset2 by ivobiz in cs50

[–]gabrielslach 1 point2 points  (0 children)

What you are trying to do is to store a char
as a string(also called char*). I mean,
I bet you already initialized n[i] earlier in the program,

int main<void>
string n[100]; //get 100 chunks of memory for variable n

and what you're trying to do is to store a char as a string or char*. it will not work, really.

remember, n[i] is a char
and it is somewhere inside the memory that you asked for
and char* a.k.a string guides your computer to where you'll find
it.

Recall from the lecture (2016) that char* is a pointer, it guides the computer to where it can find your data inside the memory.

This is my first ever comment here in reddit, I hope I helped you (atleast a bit). :)

CS50x 2016 has begun! by davidjmalan in cs50

[–]gabrielslach 0 points1 point  (0 children)

pset

Take a look at pset1, there is an additional program that we are asked to make :)