Hi (btw, I'm new in this Forum)
I'm doing a project and I have a problem with strings and char arrays (mainly because of the limited size, but also some other stuff).
I'm not sure if I need to put here the code I've done, since it's mainly small stuff, but I'll do it if you find the need.
In the program I need to open a text file chosen by the user, so I put an ifstream. Problem is: I'd like the user to be able to input an unlimited char array by a simple
cout<< "Path to file: ";
cin>> Path;
or something like this...
I tried with strings (getline) and then converting it to a char array (cause ifstream only accepts the path in char array), but for some reason the program stopped once I got to the getline part (I used "getline (cin, Filename)"). I searched for the reason, couldn't find it, tried another way.
Right now I just have:
char Path[200]
cout<< "Path to file: ";
cin>> Path;
but it will only read until it finds a " " (if I'm not wrong).
Later, there's another problem, but it's similar so, once I find a solution for that one, the other one is probably solved.
(In the project, I'm going to take the text from the text file, put it to a string and then pass it to a linked list... any suggestions about that would be greatly apreciated.
Also, I'm on my first year with Programming, so please don't get too complicated.)
Thanks in advance.