delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/21/09:30:31

From: Peter Kozics <ethpks AT eth DOT ericsson DOT se>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Error using clrscr()
Date: Mon, 21 Aug 2000 15:02:46 +0200
Organization: http://www.plasma.eth.ericsson.se
Lines: 21
Message-ID: <39A12876.69F6A862@eth.ericsson.se>
References: <39a05374$0$14726 AT SSP1NO25 DOT highway DOT telekom DOT at>
NNTP-Posting-Host: a09048.eth.ericsson.se
Mime-Version: 1.0
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In C, unlike in C++, you cannot mix declarations and statements in the
body of a coompound statement: first come declarations, then statements.

The part of the main() function enclosed in {} is a compound statement.

Try


main()
{
        clrscr();
	{	
            int Zahl;
            printf("Hello");
	}
}


Here you have nested compound statements that should work, but I didn't
verify, though.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019