Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8055107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:17:41+00:00 2026-06-05T08:17:41+00:00

#include <stdio.h> #include <windows.h> using namespace std; int main() { char s[] = Hello\n;

  • 0
#include <stdio.h>
#include <windows.h>

using namespace std;

int main() {
  char s[] = "Hello\n";
  HANDLE stdout = GetStdHandle(STD_OUTPUT_HANDLE);
  unsigned long cChars;
  WriteConsole(stdout, s, lstrlen(s), &cChars, NULL);
}

result: error: declaration of '_iob' as array of references

but when I comment out stdio.h, it compiles ok. What’s wrong here ?

Compiler is MinGW.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:17:42+00:00Added an answer on June 5, 2026 at 8:17 am

    Depending on the platform, stdout is probably a macro, so better not use that name. Replace

    HANDLE stdout = ...
    

    with

    HANDLE out = ...
    

    and then

    WriteConsole(out, ...
    

    stdout is defined in stdio.h, that’s why it fails only when this file is included. But to be safe, never use that name for any self-defined variable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#include <iostream> #include <iomanip> #include <stdio.h> #include <windows.h> #include <process.h> using namespace std; HANDLE
#include <winsock2.h> #include <windows.h> #include<stdio.h> #pragma comment(lib, Ws2_32.lib) #include <iostream> using namespace std; int
#include <stdio.h> #include <GL/gl.h> #include <GL/glut.h> #define KEY_ESCAPE 27 void display(); void keyboard(unsigned char,int,int);
#include <stdio.h> #include <stdlib.h> int main(int argc,char *argv[]) { system(PAUSE); return 0; } After
//#include StdAfx.h #include <stdio.h> #include <windows.h> #include <winbase.h> #include <iostream> #include <tchar.h> using namespace
#include<iostream> #include<vector> #include<stdexcept> #include<stdio.h> using namespace std; void keep_window_open() { cin.clear(); //clear badbit flag
#ifndef UNICODE #define UNICODE #endif #include <Windows.h> #include <cstdio> #include <fstream> using namespace std;
I was under the impression that this code #include <windows.h> #include <stdio.h> int WINAPI
#include <stdio.h> #include <string.h> #include <cstdlib> const int KEY=118; int main() { FILE* hOFile
#include<stdio.h> int main() { int i=0; printf(%d:%4d\n,++i,'\1'); printf(%d:%4d\n,++i,'\2'); printf(%d:%4d\n,++i,'\3'); printf(%d:%4d\n,++i,'\4'); printf(%d:%4d\n,++i,'\5'); printf(%d:%4d\n,++i,'\6'); printf(%d:%4d\n,++i,'\7'); printf(%d:%4d\n,++i,'\8');

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.