-
problem with getline()
dear experts,
i have encountered a strange behaviour i need your help to solve this,
i have getline function
Code:
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
std::istringstream linestream(ss1);
string item;
while (getline(linestream,item,','))
{
}
this getline function is working fine in windows but it is giving error in unix,
Unresolved text symbol "std::getline(std::basic_istream<char,std::char_traits<char> >&,std::basic_string<char,std::char_traits<char>,std::allocator<char> >&,char)"
what is the reason what can be the solution plz help me.
-
Dear Experts,
one more small query,
i want to convert a delimeter from string to int, how to do,
i am reading the delimeter in the form of string but my other module,
requires it in the form of int how to do that,
means i have
Code:
string delim=",";
but i want
int delim=',';
how to achieve this please help me.
-
Code:
string delim_string = ",";
int delim_char_code = delim_string[0];
As to your other problem, can you post a complete and compilable example that gives the same error? It sounds like maybe you're not building correctly or linking to the right libraries, but it would be good to verify that the code itself is correct.