So, I have a code that is read from a text document and saves it in char bunz . I know this sounds like a dumb question, but I prefer to use string instead of char. Will .getline accept a string if used with ifstream ? Or will I be forced to convert char to string afterwords?
Thanks.
ifstream filler("C:\\bunz.txt"); char bunz[30+1]; filler.getline(bunz, 40); cout<<bunz; filler.close();
source share