| | |
clrscr is usually given after declaration of variables. why ?
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2008
Posts: 9
Reputation:
Solved Threads: 0
clrscr() is usually given after the declaration of all variables. If it is given before the declaration(of variables), the compiler points out an error. Why is this due to ? Will there be any problem in allocating the required amount of memory if at all clrscr() is given before the declaration?
Kindly reply to this question !!
Thanks !!
Kindly reply to this question !!
Thanks !!
Regards,
Rocky.
Rocky.
If the answer is not in your text book then you need a different book! But I'm sure its in the book, you just need to study the sections about C language program structure.
C Syntax (Toggle Plain Text)
// includes go here #include <stdio.h> ... int main(int argc, char* argv[]) { // all variable declarations go here // // executable statements follow // { // new block, so more variables here // followed by executable statements } // end of block } // end of main() function
Yes -- because the iso standards say so. I have read that this requirement is going to be relaxed in the next revision of the standards, but no compilers have implemented that yet (for obvious reasons)
Last edited by Ancient Dragon; May 27th, 2009 at 8:30 am.
•
•
Join Date: Jun 2008
Posts: 9
Reputation:
Solved Threads: 0
oh!! then does this problem arise because of the problem in allocating the required amount of memory by the compiler ?
Regards,
Rocky.
Rocky.
![]() |
Similar Threads
- Passing int variables from file to main() (C)
- help me (C++)
- Declaration of variables used within the operators overloading function (C++)
- Passing arrays between subs (VB.NET)
- pascal triangle? (C)
- problem with MATLAB loop (Legacy and Other Languages)
- problem again (C)
- Adjusting screen size (Java)
- Fatal Error C010? (C)
- MERGED: Deleting duplicates in an array (plz help me out!!!!!!!) (C)
Other Threads in the C Forum
- Previous Thread: how to use C in dealing with windows
- Next Thread: calloc and malloc function
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays asterisks binarysearch calculate centimeter char convert copyanyfile copyimagefile copypdffile cprogramme createcopyoffile csyntax directory drawing dynamic executable fflush file fork frequency getlasterror givemetehcodez graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling scripting segmentationfault send shape socketprograming spoonfeeding stack standard string strings structures student suggestions systemcall test testautomation unix user variable voidmain() wab win32api windows.h






