Menu

Problem with cout and cin

2002-08-13
2012-09-26
  • Nobody/Anonymous

    Im having a problem with cout and cin with Dev-C++.  This is the script (very simple):

    #include <iostream.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <time.h>
    #include <conio.h>
    int main()
    {
    char x[255];
    cin>>x;
    cout<<x;
    return 0;
    }

    And it doesnt work, it gives me some errors that look like this:

    \DEV-C++\lib\libstdc++.a(iostream.o)(.text$__tf11_ios_fields+0x0) C:\Dev-C++\C
    multiple definition of `_ios_fields type_info function'

    I thought it was a problem with the headers so i tried compiling it with BCC32, and it worked fine.  Any ideas?

     
    • Nobody/Anonymous

      Compiles and runs here with the most recent Dev-C++ (4.9.5.0) here.  What version are you using?  Also note that:

      #include<iostream.h>

      is old and not the way to do it now.  Use

      #include<iostream>
      using namespace std;

      And you have headers in there you do not need.

      Wayne

       
    • Nobody/Anonymous

      i know, the extra headers are from another part of the program (which i know isnt causing it).  I have 4.9.5.0, but i recently updated it(didnt download the full version either).  Thats probably the problem.  Ill use BCC32 for DOS programs and DEV-C++ for windows.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.