top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Why #include<iostream.h> is showing header file missing error in C?

+2 votes
415 views

Sorry for silly question?

posted Dec 18, 2015 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes

iostream is defined in c++ for input output library. First of all don't use .h extension while including iostream. And another point is that use by using gcc , it code would not compile.
Solution:

include /* Write in code */

/* compile with g++ */

answer Dec 18, 2015 by Harshita
0 votes

Just try

#include "iostream" 

and compile using g++ or any c++ compiler.

answer Dec 19, 2015 by Salil Agrawal
Similar Questions
+4 votes
#include<stdio.h>
int var;
int var;
int var;

int main(void) { 
  printf("%d \n",var); 
  return 0;
}
+5 votes

What would be the drawback if we define a static variable in the header file?

+5 votes

You can find three principal uses for the static. This is a good way how to start your answer to this question. Let’s look at the three principal uses:

  1. Firstly, when you declare inside of a function: This retains the value between function calls

  2. Secondly, when it is declared for the function name: By default function is extern..therefore it will be visible out of different files if the function declaration is set as static..it will be invisible for outer files

  3. And lastly, static for global parameters: By default you can use global variables from outside files When it’s static global..this variable will be limited to within the file.

is this right ?

...