| | |
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: 652 | Replies: 11
| Thread Tools | Search this Thread |
Tag cloud for C
#include * array arrays asterisks binarysearch calculate changingto char cm command copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic execv fflush file fork forloop framework functions getlasterror givemetehcodez grade graphics gtkwinlinux hacking hardware histogram homework inches include incrementoperators input iso kernel keyboard km lazy linked linkedlist linux list lists locate logical_drives looping loopinsideloop. lowest matrix microsoft motherboard mqqueue mysql number opendocumentformat opensource overwrite owf pattern pdf performance pointer pointers posix problem probleminc process program programming radix recursion recv research reversing scanf scripting segmentationfault sequential socket socketprograming spoonfeeding standard string structures student systemcall testing threads turboc unix user variable voidmain() wab whythiscodecausesegmentationfault windowsapi






