Thread: Weirdest Problem i've ever encountered!Please help me

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    225
    Elysia try the code first !!
    iostream should not be included as fstream is inherited from iostream only!!

    So for your kind information when fstream is included there's no need to include iostream

    http://www.cplusplus.com/reference/iostream/fstream/

    Secondly do you mean to say!!if i have 20 members in class i should take input of 20 members in main 1 by 1??and then write a function which takes 20 arguments and copies 1 by 1 to class members?!!!??? That's pretty funny isn't it?

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by chottachatri View Post
    Elysia try the code first !!
    I did and it did not compile.

    iostream should not be included as fstream is inherited from iostream only!!
    So for your kind information when fstream is included there's no need to include iostream
    That is irrelevant. If you use something defined in the iostream header, then include it. It did not compile until I included the iostream header, which tells us a lot. Do it.

    Secondly do you mean to say!!if i have 20 members in class i should take input of 20 members in main 1 by 1??and then write a function which takes 20 arguments and copies 1 by 1 to class members?!!!??? That's pretty funny isn't it?
    The code will be the same, in or outside the class.
    The class represents the data, it is the essence of the data, it does not ask FOR data. If it does, then you have the concept of classes wrong.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  5. beginner problem
    By The_Nymph in forum C Programming
    Replies: 4
    Last Post: 03-05-2002, 05:46 PM