Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8141101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:23:16+00:00 2026-06-06T12:23:16+00:00

I am compiling following code and getting following error. How to fix this? Thanks

  • 0

I am compiling following code and getting following error. How to fix this? Thanks for your help.

error C2079: ‘issline’ uses undefined class
‘std::basic_istringstream<_Elem,_Traits,_Alloc>’ 1> with 1>
[ 1> _Elem=char, 1>
_Traits=std::char_traits, 1> _Alloc=std::allocator 1> ] 1>d:\technical\c++study\readparsing\readparsing\main.cpp(49) : error
C2440: ‘initializing’ : cannot convert from ‘std::string’ to ‘int’ 1>
No user-defined-conversion operator available that can perform this
conversion, or the operator cannot be called
1>d:\technical\c++study\readparsing\readparsing\main.cpp(51) : error
C2678: binary ‘>>’ : no operator found which takes a left-hand operand
of type ‘int’ (or there is no acceptable conversion) 1>
d:\technical\c++study\readparsing\readparsing\timestamp.h(31): could
be ‘std::istream &operator >>(std::istream &,TimeStamp &)’ 1>
while trying to match the argument list ‘(int, TimeStamp)’

I have following code in TimeStamp.h

#ifndef __TIMESTAMP_
#define __TIMESTAMP_

#include <iostream>

struct DateTime
{
    unsigned int dwLowDateTime;
    unsigned int  dwHighDateTime;
};


class TimeStamp 
{
public:
    TimeStamp()
    {
        m_time.dwHighDateTime = 0;
        m_time.dwLowDateTime = 0;
    }

    TimeStamp& operator = (unsigned __int64 other)
    {
        *( unsigned __int64*)&m_time = other;
        return *this;
    }
private:
    DateTime        m_time;
};

std::istream& operator >> (std::istream& input, TimeStamp& timeStamp);

#endif

In main.cpp I have following

#include <iostream>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

#include "TimeStamp.h"

std::istream& operator >> (std::istream& input, TimeStamp& timeStamp)
{
    // 1.
    // use regular stream operator parsing technique to parse individual integer x values (separated in the form "xxxx-xx-xx xx:xx:xx.xxx")
    // for year, month, day, hour, minute, seconds, mseconds
    unsigned int year;
    unsigned int month;
    unsigned int day;
    unsigned int hour;
    unsigned int minute;
    unsigned int seconds;
    unsigned int milliSeconds;
    char dash;
    char colon;

    input >> year >> dash >> month >> dash >> day >> hour >> colon >> minute >> colon >> seconds >> colon >> milliSeconds;

    cout << "Time stamp opeator is called " << std::endl;

    // 2.
    // code to be written.

    return input;
}



int main () {

    std::string dateTime = "2012-06-25 12:00:10.000";

    TimeStamp myTimeStamp;

    std::istringstream issline(dateTime);

    issline >> myTimeStamp;


   return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:23:19+00:00Added an answer on June 6, 2026 at 12:23 pm

    I think you need to #include <sstream> to use istringstream.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code and am getting this error before compiling: Fast Enumeration
The following C++ code gives an error while compiling: #include<iostream> using namespace std; class
While compiling my code I am getting the following error. Why is throwing an
I am getting the following error when compiling my code _CGRectZero, referenced from: _CGRectZero$non_lazy_ptr
guys, I have the following code, but I'm getting error at compiling time... the
While compiling the c++ code using android NDK I am getting the following error:
I am getting the error while compiling the following simple C++ class program .
I was compiling the following code: class B; class A { A(); friend A
I am getting the following error message when compiling or attempting to run my
I'm following the provided instructions but is not working. I'm getting this error: INFO:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.