codes to search within a txt file using QT with c++
I am working on a school project right now, and I need to build a Student Management System with QT. I have a txt file with student information listed in a line like:
Studentname accountpassword studentid
Every time a user(student) input their studentname and password, I have to check if the name and password are in the database (which is the txt file right now).
This is what I am struggling with right now. I don't know how I can only search line by line. For example, if the first student user name is jack, and his password is 123456; At the same time, second student user name is peter, and his password is 23567.
How can I check if the username jack and 123456 are inputted at the same time?
void MainWindow::on_loginpush_clicked()
{
QString username = ui -> lineedit_username -> text();
QString password = ui -> lineedit_password -> text();
if (username == "admin" && password =="admin")
{
Adminmanagment adminview;
adminview.exec();
}
else if( (username != "admin") && (password !="admin"))
{
ifstream studentinfo("student.txt");
if (!studentinfo.is_open())
{
}
else
{
string current_name;
string current_password;
string id;
int numofcourses;
int gpa;
char newline;
char space;
bool valid =false;
while((studentinfo>>current_name>>current_password>>id>>numofcourses>>gpa>>noskipws>>newline) &&newline == 'n')
{
if((current_name == username)&& (current_password== password))
{
}
}
}
}
My student.txt looks exactly like below
name password id number of courses gpa
jack 123456 900440123 4 0
testing 987654 900542015 4 2
testing2 8888 900145265 4 2
testing3 8888 900158256 4 0
c++ qt
add a comment |
I am working on a school project right now, and I need to build a Student Management System with QT. I have a txt file with student information listed in a line like:
Studentname accountpassword studentid
Every time a user(student) input their studentname and password, I have to check if the name and password are in the database (which is the txt file right now).
This is what I am struggling with right now. I don't know how I can only search line by line. For example, if the first student user name is jack, and his password is 123456; At the same time, second student user name is peter, and his password is 23567.
How can I check if the username jack and 123456 are inputted at the same time?
void MainWindow::on_loginpush_clicked()
{
QString username = ui -> lineedit_username -> text();
QString password = ui -> lineedit_password -> text();
if (username == "admin" && password =="admin")
{
Adminmanagment adminview;
adminview.exec();
}
else if( (username != "admin") && (password !="admin"))
{
ifstream studentinfo("student.txt");
if (!studentinfo.is_open())
{
}
else
{
string current_name;
string current_password;
string id;
int numofcourses;
int gpa;
char newline;
char space;
bool valid =false;
while((studentinfo>>current_name>>current_password>>id>>numofcourses>>gpa>>noskipws>>newline) &&newline == 'n')
{
if((current_name == username)&& (current_password== password))
{
}
}
}
}
My student.txt looks exactly like below
name password id number of courses gpa
jack 123456 900440123 4 0
testing 987654 900542015 4 2
testing2 8888 900145265 4 2
testing3 8888 900158256 4 0
c++ qt
You need to look at using std::getline and also string tokenisation.
– Gregroy Currie
Nov 23 '18 at 3:35
Hi sir, thank you for answering and I will check it out right now.
– Stefan
Nov 23 '18 at 4:01
add a comment |
I am working on a school project right now, and I need to build a Student Management System with QT. I have a txt file with student information listed in a line like:
Studentname accountpassword studentid
Every time a user(student) input their studentname and password, I have to check if the name and password are in the database (which is the txt file right now).
This is what I am struggling with right now. I don't know how I can only search line by line. For example, if the first student user name is jack, and his password is 123456; At the same time, second student user name is peter, and his password is 23567.
How can I check if the username jack and 123456 are inputted at the same time?
void MainWindow::on_loginpush_clicked()
{
QString username = ui -> lineedit_username -> text();
QString password = ui -> lineedit_password -> text();
if (username == "admin" && password =="admin")
{
Adminmanagment adminview;
adminview.exec();
}
else if( (username != "admin") && (password !="admin"))
{
ifstream studentinfo("student.txt");
if (!studentinfo.is_open())
{
}
else
{
string current_name;
string current_password;
string id;
int numofcourses;
int gpa;
char newline;
char space;
bool valid =false;
while((studentinfo>>current_name>>current_password>>id>>numofcourses>>gpa>>noskipws>>newline) &&newline == 'n')
{
if((current_name == username)&& (current_password== password))
{
}
}
}
}
My student.txt looks exactly like below
name password id number of courses gpa
jack 123456 900440123 4 0
testing 987654 900542015 4 2
testing2 8888 900145265 4 2
testing3 8888 900158256 4 0
c++ qt
I am working on a school project right now, and I need to build a Student Management System with QT. I have a txt file with student information listed in a line like:
Studentname accountpassword studentid
Every time a user(student) input their studentname and password, I have to check if the name and password are in the database (which is the txt file right now).
This is what I am struggling with right now. I don't know how I can only search line by line. For example, if the first student user name is jack, and his password is 123456; At the same time, second student user name is peter, and his password is 23567.
How can I check if the username jack and 123456 are inputted at the same time?
void MainWindow::on_loginpush_clicked()
{
QString username = ui -> lineedit_username -> text();
QString password = ui -> lineedit_password -> text();
if (username == "admin" && password =="admin")
{
Adminmanagment adminview;
adminview.exec();
}
else if( (username != "admin") && (password !="admin"))
{
ifstream studentinfo("student.txt");
if (!studentinfo.is_open())
{
}
else
{
string current_name;
string current_password;
string id;
int numofcourses;
int gpa;
char newline;
char space;
bool valid =false;
while((studentinfo>>current_name>>current_password>>id>>numofcourses>>gpa>>noskipws>>newline) &&newline == 'n')
{
if((current_name == username)&& (current_password== password))
{
}
}
}
}
My student.txt looks exactly like below
name password id number of courses gpa
jack 123456 900440123 4 0
testing 987654 900542015 4 2
testing2 8888 900145265 4 2
testing3 8888 900158256 4 0
c++ qt
c++ qt
edited Nov 23 '18 at 6:39
Swordfish
1
1
asked Nov 23 '18 at 3:32
Stefan
83
83
You need to look at using std::getline and also string tokenisation.
– Gregroy Currie
Nov 23 '18 at 3:35
Hi sir, thank you for answering and I will check it out right now.
– Stefan
Nov 23 '18 at 4:01
add a comment |
You need to look at using std::getline and also string tokenisation.
– Gregroy Currie
Nov 23 '18 at 3:35
Hi sir, thank you for answering and I will check it out right now.
– Stefan
Nov 23 '18 at 4:01
You need to look at using std::getline and also string tokenisation.
– Gregroy Currie
Nov 23 '18 at 3:35
You need to look at using std::getline and also string tokenisation.
– Gregroy Currie
Nov 23 '18 at 3:35
Hi sir, thank you for answering and I will check it out right now.
– Stefan
Nov 23 '18 at 4:01
Hi sir, thank you for answering and I will check it out right now.
– Stefan
Nov 23 '18 at 4:01
add a comment |
2 Answers
2
active
oldest
votes
Untested. Expects every line (including last line) ending with a newline character. Given you have 2 QStrings username
and password
:
#include <fstream>
#include <string>
#include <cctype> // std::isspace()
// ...
std::istream& eat_whitespace(std::istream &is) // eats whitespace except 'n'
{
int ch;
while (is && (ch = is.peek()) != EOF && ch != 'n'
&& std::isspace(static_cast<char unsigned>(ch)))
{
is.get();
}
return is;
}
// ...
std::ifstream studentinfo{ "your_file" };
if (!studentinfo.is_open())
// big trouble
std::string current_name;
std::string current_password;
std::string id;
int numofcourses;
int gpa;
char newline;
bool valid = false;
while ((studentinfo >> current_name >> current_password >> id >> numofcourses >> gpa
>> eat_whitespace >> std::noskipws >> newline >> std::skipws )
&& newline == 'n')
{
if (current_name == username.toLocal8Bit().constData() &&
current_password == password.toLocal8Bit().constData())
{
valid = true;
break;
}
}
// valid now true if credentials found.
This is my first time using QT and c++ in the same time, so I am a bit confused. I know this will work in a typical cpp file, but for some reason it has a lot error when I create a cpp file and input all these codes into it. Can you guys please tell me why codes in QT is different than the codes in vs?
– Stefan
Nov 23 '18 at 3:59
@Stefan You realize that my answer only shows the principle? C++ is no different with or without Qt. If you show what you tried and which errors you get it would be possible to assist you. You could edit your question to contain the relevant code.
– Swordfish
Nov 23 '18 at 4:23
Thank you for all your help sir. I just edited my question with the partial code that I have question with. So basically I have two QLineEdit to collect user's input on username and password, and I hope to check if the inputs matching the username and pw in my txt file. The error I have now is I used QString to collect the username and password, and the program does not let me to compare QString and String.
– Stefan
Nov 23 '18 at 4:51
@Stefan And what errors do you get?
– Swordfish
Nov 23 '18 at 4:55
something called Semantic Issue 59:38: error: invalid operands to binary expression ('std::__cxx11::string' (aka 'basic_string<char>') and 'QString') It has a long list of detail. If you need them too, please let me know.
– Stefan
Nov 23 '18 at 4:58
|
show 17 more comments
You mentioned that you are using Qt. This question shows how to read a file line by line(Read a text file line by line in Qt) with Qfile.
You could then use QStrings in built equality operators to see if they’re the same. http://doc.qt.io/qt-5/qstring.html
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53440351%2fcodes-to-search-within-a-txt-file-using-qt-with-c%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Untested. Expects every line (including last line) ending with a newline character. Given you have 2 QStrings username
and password
:
#include <fstream>
#include <string>
#include <cctype> // std::isspace()
// ...
std::istream& eat_whitespace(std::istream &is) // eats whitespace except 'n'
{
int ch;
while (is && (ch = is.peek()) != EOF && ch != 'n'
&& std::isspace(static_cast<char unsigned>(ch)))
{
is.get();
}
return is;
}
// ...
std::ifstream studentinfo{ "your_file" };
if (!studentinfo.is_open())
// big trouble
std::string current_name;
std::string current_password;
std::string id;
int numofcourses;
int gpa;
char newline;
bool valid = false;
while ((studentinfo >> current_name >> current_password >> id >> numofcourses >> gpa
>> eat_whitespace >> std::noskipws >> newline >> std::skipws )
&& newline == 'n')
{
if (current_name == username.toLocal8Bit().constData() &&
current_password == password.toLocal8Bit().constData())
{
valid = true;
break;
}
}
// valid now true if credentials found.
This is my first time using QT and c++ in the same time, so I am a bit confused. I know this will work in a typical cpp file, but for some reason it has a lot error when I create a cpp file and input all these codes into it. Can you guys please tell me why codes in QT is different than the codes in vs?
– Stefan
Nov 23 '18 at 3:59
@Stefan You realize that my answer only shows the principle? C++ is no different with or without Qt. If you show what you tried and which errors you get it would be possible to assist you. You could edit your question to contain the relevant code.
– Swordfish
Nov 23 '18 at 4:23
Thank you for all your help sir. I just edited my question with the partial code that I have question with. So basically I have two QLineEdit to collect user's input on username and password, and I hope to check if the inputs matching the username and pw in my txt file. The error I have now is I used QString to collect the username and password, and the program does not let me to compare QString and String.
– Stefan
Nov 23 '18 at 4:51
@Stefan And what errors do you get?
– Swordfish
Nov 23 '18 at 4:55
something called Semantic Issue 59:38: error: invalid operands to binary expression ('std::__cxx11::string' (aka 'basic_string<char>') and 'QString') It has a long list of detail. If you need them too, please let me know.
– Stefan
Nov 23 '18 at 4:58
|
show 17 more comments
Untested. Expects every line (including last line) ending with a newline character. Given you have 2 QStrings username
and password
:
#include <fstream>
#include <string>
#include <cctype> // std::isspace()
// ...
std::istream& eat_whitespace(std::istream &is) // eats whitespace except 'n'
{
int ch;
while (is && (ch = is.peek()) != EOF && ch != 'n'
&& std::isspace(static_cast<char unsigned>(ch)))
{
is.get();
}
return is;
}
// ...
std::ifstream studentinfo{ "your_file" };
if (!studentinfo.is_open())
// big trouble
std::string current_name;
std::string current_password;
std::string id;
int numofcourses;
int gpa;
char newline;
bool valid = false;
while ((studentinfo >> current_name >> current_password >> id >> numofcourses >> gpa
>> eat_whitespace >> std::noskipws >> newline >> std::skipws )
&& newline == 'n')
{
if (current_name == username.toLocal8Bit().constData() &&
current_password == password.toLocal8Bit().constData())
{
valid = true;
break;
}
}
// valid now true if credentials found.
This is my first time using QT and c++ in the same time, so I am a bit confused. I know this will work in a typical cpp file, but for some reason it has a lot error when I create a cpp file and input all these codes into it. Can you guys please tell me why codes in QT is different than the codes in vs?
– Stefan
Nov 23 '18 at 3:59
@Stefan You realize that my answer only shows the principle? C++ is no different with or without Qt. If you show what you tried and which errors you get it would be possible to assist you. You could edit your question to contain the relevant code.
– Swordfish
Nov 23 '18 at 4:23
Thank you for all your help sir. I just edited my question with the partial code that I have question with. So basically I have two QLineEdit to collect user's input on username and password, and I hope to check if the inputs matching the username and pw in my txt file. The error I have now is I used QString to collect the username and password, and the program does not let me to compare QString and String.
– Stefan
Nov 23 '18 at 4:51
@Stefan And what errors do you get?
– Swordfish
Nov 23 '18 at 4:55
something called Semantic Issue 59:38: error: invalid operands to binary expression ('std::__cxx11::string' (aka 'basic_string<char>') and 'QString') It has a long list of detail. If you need them too, please let me know.
– Stefan
Nov 23 '18 at 4:58
|
show 17 more comments
Untested. Expects every line (including last line) ending with a newline character. Given you have 2 QStrings username
and password
:
#include <fstream>
#include <string>
#include <cctype> // std::isspace()
// ...
std::istream& eat_whitespace(std::istream &is) // eats whitespace except 'n'
{
int ch;
while (is && (ch = is.peek()) != EOF && ch != 'n'
&& std::isspace(static_cast<char unsigned>(ch)))
{
is.get();
}
return is;
}
// ...
std::ifstream studentinfo{ "your_file" };
if (!studentinfo.is_open())
// big trouble
std::string current_name;
std::string current_password;
std::string id;
int numofcourses;
int gpa;
char newline;
bool valid = false;
while ((studentinfo >> current_name >> current_password >> id >> numofcourses >> gpa
>> eat_whitespace >> std::noskipws >> newline >> std::skipws )
&& newline == 'n')
{
if (current_name == username.toLocal8Bit().constData() &&
current_password == password.toLocal8Bit().constData())
{
valid = true;
break;
}
}
// valid now true if credentials found.
Untested. Expects every line (including last line) ending with a newline character. Given you have 2 QStrings username
and password
:
#include <fstream>
#include <string>
#include <cctype> // std::isspace()
// ...
std::istream& eat_whitespace(std::istream &is) // eats whitespace except 'n'
{
int ch;
while (is && (ch = is.peek()) != EOF && ch != 'n'
&& std::isspace(static_cast<char unsigned>(ch)))
{
is.get();
}
return is;
}
// ...
std::ifstream studentinfo{ "your_file" };
if (!studentinfo.is_open())
// big trouble
std::string current_name;
std::string current_password;
std::string id;
int numofcourses;
int gpa;
char newline;
bool valid = false;
while ((studentinfo >> current_name >> current_password >> id >> numofcourses >> gpa
>> eat_whitespace >> std::noskipws >> newline >> std::skipws )
&& newline == 'n')
{
if (current_name == username.toLocal8Bit().constData() &&
current_password == password.toLocal8Bit().constData())
{
valid = true;
break;
}
}
// valid now true if credentials found.
edited Nov 23 '18 at 15:48
answered Nov 23 '18 at 3:48
Swordfish
1
1
This is my first time using QT and c++ in the same time, so I am a bit confused. I know this will work in a typical cpp file, but for some reason it has a lot error when I create a cpp file and input all these codes into it. Can you guys please tell me why codes in QT is different than the codes in vs?
– Stefan
Nov 23 '18 at 3:59
@Stefan You realize that my answer only shows the principle? C++ is no different with or without Qt. If you show what you tried and which errors you get it would be possible to assist you. You could edit your question to contain the relevant code.
– Swordfish
Nov 23 '18 at 4:23
Thank you for all your help sir. I just edited my question with the partial code that I have question with. So basically I have two QLineEdit to collect user's input on username and password, and I hope to check if the inputs matching the username and pw in my txt file. The error I have now is I used QString to collect the username and password, and the program does not let me to compare QString and String.
– Stefan
Nov 23 '18 at 4:51
@Stefan And what errors do you get?
– Swordfish
Nov 23 '18 at 4:55
something called Semantic Issue 59:38: error: invalid operands to binary expression ('std::__cxx11::string' (aka 'basic_string<char>') and 'QString') It has a long list of detail. If you need them too, please let me know.
– Stefan
Nov 23 '18 at 4:58
|
show 17 more comments
This is my first time using QT and c++ in the same time, so I am a bit confused. I know this will work in a typical cpp file, but for some reason it has a lot error when I create a cpp file and input all these codes into it. Can you guys please tell me why codes in QT is different than the codes in vs?
– Stefan
Nov 23 '18 at 3:59
@Stefan You realize that my answer only shows the principle? C++ is no different with or without Qt. If you show what you tried and which errors you get it would be possible to assist you. You could edit your question to contain the relevant code.
– Swordfish
Nov 23 '18 at 4:23
Thank you for all your help sir. I just edited my question with the partial code that I have question with. So basically I have two QLineEdit to collect user's input on username and password, and I hope to check if the inputs matching the username and pw in my txt file. The error I have now is I used QString to collect the username and password, and the program does not let me to compare QString and String.
– Stefan
Nov 23 '18 at 4:51
@Stefan And what errors do you get?
– Swordfish
Nov 23 '18 at 4:55
something called Semantic Issue 59:38: error: invalid operands to binary expression ('std::__cxx11::string' (aka 'basic_string<char>') and 'QString') It has a long list of detail. If you need them too, please let me know.
– Stefan
Nov 23 '18 at 4:58
This is my first time using QT and c++ in the same time, so I am a bit confused. I know this will work in a typical cpp file, but for some reason it has a lot error when I create a cpp file and input all these codes into it. Can you guys please tell me why codes in QT is different than the codes in vs?
– Stefan
Nov 23 '18 at 3:59
This is my first time using QT and c++ in the same time, so I am a bit confused. I know this will work in a typical cpp file, but for some reason it has a lot error when I create a cpp file and input all these codes into it. Can you guys please tell me why codes in QT is different than the codes in vs?
– Stefan
Nov 23 '18 at 3:59
@Stefan You realize that my answer only shows the principle? C++ is no different with or without Qt. If you show what you tried and which errors you get it would be possible to assist you. You could edit your question to contain the relevant code.
– Swordfish
Nov 23 '18 at 4:23
@Stefan You realize that my answer only shows the principle? C++ is no different with or without Qt. If you show what you tried and which errors you get it would be possible to assist you. You could edit your question to contain the relevant code.
– Swordfish
Nov 23 '18 at 4:23
Thank you for all your help sir. I just edited my question with the partial code that I have question with. So basically I have two QLineEdit to collect user's input on username and password, and I hope to check if the inputs matching the username and pw in my txt file. The error I have now is I used QString to collect the username and password, and the program does not let me to compare QString and String.
– Stefan
Nov 23 '18 at 4:51
Thank you for all your help sir. I just edited my question with the partial code that I have question with. So basically I have two QLineEdit to collect user's input on username and password, and I hope to check if the inputs matching the username and pw in my txt file. The error I have now is I used QString to collect the username and password, and the program does not let me to compare QString and String.
– Stefan
Nov 23 '18 at 4:51
@Stefan And what errors do you get?
– Swordfish
Nov 23 '18 at 4:55
@Stefan And what errors do you get?
– Swordfish
Nov 23 '18 at 4:55
something called Semantic Issue 59:38: error: invalid operands to binary expression ('std::__cxx11::string' (aka 'basic_string<char>') and 'QString') It has a long list of detail. If you need them too, please let me know.
– Stefan
Nov 23 '18 at 4:58
something called Semantic Issue 59:38: error: invalid operands to binary expression ('std::__cxx11::string' (aka 'basic_string<char>') and 'QString') It has a long list of detail. If you need them too, please let me know.
– Stefan
Nov 23 '18 at 4:58
|
show 17 more comments
You mentioned that you are using Qt. This question shows how to read a file line by line(Read a text file line by line in Qt) with Qfile.
You could then use QStrings in built equality operators to see if they’re the same. http://doc.qt.io/qt-5/qstring.html
add a comment |
You mentioned that you are using Qt. This question shows how to read a file line by line(Read a text file line by line in Qt) with Qfile.
You could then use QStrings in built equality operators to see if they’re the same. http://doc.qt.io/qt-5/qstring.html
add a comment |
You mentioned that you are using Qt. This question shows how to read a file line by line(Read a text file line by line in Qt) with Qfile.
You could then use QStrings in built equality operators to see if they’re the same. http://doc.qt.io/qt-5/qstring.html
You mentioned that you are using Qt. This question shows how to read a file line by line(Read a text file line by line in Qt) with Qfile.
You could then use QStrings in built equality operators to see if they’re the same. http://doc.qt.io/qt-5/qstring.html
answered Nov 23 '18 at 4:02
Kieran
465
465
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53440351%2fcodes-to-search-within-a-txt-file-using-qt-with-c%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You need to look at using std::getline and also string tokenisation.
– Gregroy Currie
Nov 23 '18 at 3:35
Hi sir, thank you for answering and I will check it out right now.
– Stefan
Nov 23 '18 at 4:01