| | |
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 |
#include * append array arrays asterisks bash binarysearch calculate changingto char character cm copyimagefile creafecopyofanytypeoffileinc createprocess() database dynamic execv feet fgets file floatingpointvalidation fork forloop framework function getlogicaldrivestrin givemetehcodez global grade gtkwinlinux hacking histogram ide include incrementoperators input intmain() iso kernel keyboard kilometer km license linked linkedlist linux list lists locate logical_drives looping loopinsideloop. lowest matrix meter microsoft mqqueue number oddnumber odf opensource openwebfoundation overwrite owf pdf performance pointer posix probleminc process program programming radix recursion recv recvblocked research reversing scripting segmentationfault sequential single socket socketprogramming standard strchr string systemcall testing threads turboc unix urboc user variable wab whythiscodecausesegmentationfault windowsapi






