| | |
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
Views: 646 | Replies: 11
| Thread Tools | Search this Thread |
Tag cloud for C
* adobe api append array arrays bash binarysearch centimeter char character cm copyanyfile copypdffile createcopyoffile createprocess() csyntax directory drawing dynamic executable execv feet fgets file floatingpointvalidation fork frequency function getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling gtkwinlinux highest homework i/o ide infiniteloop initialization interest intmain() kilometer lazy license linked linkedlist linux linuxsegmentationfault list match matrix meter microsoft mqqueue multi mysql oddnumber odf open openwebfoundation pause pdf pointer pointers posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition scheduling segmentationfault send shape single socketprogramming spoonfeeding stack standard strchr string strings student suggestions system test testautomation unix urboc user whythiscodecausesegmentationfault win32 win32api windows.h






