initial question

This is a discussion on initial question within the C++ Programming forums, part of the General Programming Boards category; the iostream.h did exist in the directory, but i can't include it i use vc6 please help me Code: // ...

  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
    19,391
    Perhaps try:
    Code:
    #include <iostream>
    int main(int argc, char* argv[])
    {
    	std::cout << "Hello World!\n";
    	return 0;
    }
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    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,470
    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
    I'm just trying to be a better person - My Name Is Earl

  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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    5,636
    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
    If I have eight hours for cutting wood, I spend six sharpening my axe.

  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,470
    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
    I'm just trying to be a better person - My Name Is Earl

  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, 04: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, 08:22 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 12:47 AM

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