problem with getline()

This is a discussion on problem with getline() within the C++ Programming forums, part of the General Programming Boards category; dear experts, i have encountered a strange behaviour i need your help to solve this, i have getline function Code: ...

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    99

    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.

  2. #2
    Registered User
    Join Date
    Nov 2007
    Posts
    99
    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.

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    7,325
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bin packing problem....
    By 81N4RY_DR460N in forum C++ Programming
    Replies: 0
    Last Post: 08-01-2005, 05:20 AM
  2. Words and lines count problem
    By emo in forum C Programming
    Replies: 1
    Last Post: 07-12-2005, 03:36 PM
  3. getline() problem
    By mrafcho001 in forum C++ Programming
    Replies: 5
    Last Post: 06-12-2005, 01:16 AM
  4. Need help with structures
    By yoursport in forum C++ Programming
    Replies: 8
    Last Post: 04-20-2005, 11:59 AM
  5. getline help
    By ProjectsProject in forum C++ Programming
    Replies: 3
    Last Post: 06-14-2004, 11:12 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21