| | |
clrscr is usually given after declaration of variables. why ?
![]() |
•
•
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 |
* adobe ansi api array arrays bash binarysearch calculate centimeter char cm convert copyanyfile copypdffile createcopyoffile createprocess() csyntax directory dynamic fflush file floatingpointvalidation fork forloop frequency getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling gtkwinlinux hardware highest homework i/o ide inches initialization intmain() iso km linked linkedlist linux linuxsegmentationfault list logical_drives loopinsideloop. lowest match matrix microsoft motherboard mqqueue mysql oddnumber odf open opendocumentformat opensource openwebfoundation pattern pdf performance pointer pointers posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition reversing scanf scheduling segmentationfault send shape single socketprogramming stack standard strchr string suggestions test unix urboc user variable voidmain() whythiscodecausesegmentationfault win32api windows.h






