Thread: initial question

  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    9

    initial question

    the iostream.h did exist in the directory, but i can't include it
    i use vc6
    please help me
    Code:
    // aaa.cpp : Defines the entry point for the console application.
    //
    
    #include "stdafx.h"
    #include "iostream.h"
    int main(int argc, char* argv[])
    {
    	printf("Hello World!\n");
    	return 0;
    }
    Deleting intermediate files and output files for project 'aaa - Win32 Debug'.
    --------------------Configuration: aaa - Win32 Debug--------------------
    Compiling...
    StdAfx.cpp
    Compiling...
    aaa.cpp
    c:\vc6.0_mini\microsoft visual studio\vc98\include\iostream.h(52) : fatal error C1083: Cannot open include file: 'ios.h': No such file or directory
    Error executing cl.exe.

    aaa.exe - 1 error(s), 0 warning(s)

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Perhaps try:
    Code:
    #include <iostream>
    int main(int argc, char* argv[])
    {
    	std::cout << "Hello World!\n";
    	return 0;
    }
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    iostream.h is a deceprecated header file. It works on much older compilers ( like Turbo C++ ) but more standard compliant ones will issue a warning a least if you attempt to use it
    Double Helix STL

  4. #4
    Registered User
    Join Date
    Dec 2006
    Posts
    9
    it did't work either

    the directory is corrent
    i try #include <malloc> it is an error
    Cannot open include file: 'malloc': No such..
    but #include "malloc.h" is ok

    i doubt is the setting..
    how to set the "c/c++" tab

  5. #5
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by swgh
    iostream.h is a deceprecated header file.
    Not deprecated...
    Deprecated functions or header files are still supported by the standard but not recomended for usage...

    iostream.h is not supported by the standard
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  6. #6
    Registered User
    Join Date
    Dec 2006
    Posts
    9
    i look for msdn the "c1083 error" and i exclude the 1 to 6 reasons
    but the "maybe" reason 7 and 8 i don't know what it mean

  7. #7
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    i look for msdn the "c1083 error" and i exclude the 1 to 6 reasons
    but the "maybe" reason 7 and 8 i don't know what it mean
    What was reason 7 and 8? Malloc is an old C function that deals with memory allocation if I remember when I used to code in C. But if you are using C++, you would use the new and delete keywords when dealing with allocations using pointers
    Double Helix STL

  8. #8
    Registered User
    Join Date
    Dec 2004
    Posts
    32
    Quote Originally Posted by peachchentao
    the iostream.h did exist in the directory, but i can't include it
    i use vc6
    please help me
    Code:
    // aaa.cpp : Defines the entry point for the console application.
    //
    
    #include "stdafx.h"
    #include "iostream.h"
    int main(int argc, char* argv[])
    {
    	printf("Hello World!\n");
    	return 0;
    }
    Deleting intermediate files and output files for project 'aaa - Win32 Debug'.
    --------------------Configuration: aaa - Win32 Debug--------------------
    Compiling...
    StdAfx.cpp
    Compiling...
    aaa.cpp
    c:\vc6.0_mini\microsoft visual studio\vc98\include\iostream.h(52) : fatal error C1083: Cannot open include file: 'ios.h': No such file or directory
    Error executing cl.exe.

    aaa.exe - 1 error(s), 0 warning(s)
    Is there a reason you are using double quotes? If not try #include <iostream.h>
    Also printf is in "stdio".
    So maybe,
    Code:
    #include "stdafx.h"
    #include <stdio.h>
    int main(int argc, char* argv[])
    {
    	printf("Hello World!\n");
    	return 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. My first game
    By homeyg in forum Game Programming
    Replies: 20
    Last Post: 12-22-2004, 05:25 PM
  2. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  3. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  4. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM