Trying to write a parser and I keep getting stuck on this one part. I'm using visual studio 2015 and I swear either i'm stupid or visual studio is trolling me. I've included so many headers, I've tried writing it several ways
cin.getline()
getline()
std::getline(std::cin,x)
and i get the same errors
>c:\users\brian\desktop\hacking and programming\c++\testing\testing\source.cpp(11): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\brian\desktop\hacking and programming\c++\testing\testing\source.cpp(18): error C2664: 'std::basic_istream<char,std::char_traits<char>> &std::basic_istream<char,std::char_traits<char>>::getline(_Elem *,std::streamsize,_Elem)': cannot convert argument 1 from 'std::istream' to 'char *'
1> with
1> [
1> _Elem=char
1> ]
1> c:\users\brian\desktop\hacking and programming\c++\testing\testing\source.cpp(18): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <iostream>
#include <cstdlib>
#include <cctype>
#include <cstring>
usingnamespace std;
main()
{
string user;
char text_array[256];
cout << "Hi there cherished user, please enter a mathematical formula :D\n";
getline (cin, user,);
}
Thanks for taking time to read this and any advice would be appreciated
When given multiple errors it helps if you only look at them one at a time, fixing a single error. Many times fixing a single error fixes multiple errors.