![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2005
Posts: 12
Rep Power: 0
![]() |
Help stupid problem with clrscr
#include<math.h>
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
void main()
{
clrscr();
int i;
for (i=1;i<10;i++)
{ printf("the values of the square root of %d is %d \n",i,sqrt((double)i)); }
}guys my compiler Turbo c is saying that declaration not allowed here .... for the clrscr line... i know it may sound stupid ... need help |
|
|
|
|
|
#2 |
|
Professional Programmer
![]() Join Date: Sep 2005
Posts: 419
Rep Power: 4
![]() |
Declarations come before everything else. A function call is not a declaration.
__________________
Even if the voices aren't real, they have some pretty good ideas. |
|
|
|
|
|
#3 |
|
Programming Guru
![]() |
Next time try pasting code you've written with the [Enter] key...
All that's saying is that clrscr() is not defined. Add this under your includes... #ifdef WIN32
# define clrscr() system("cls")
#else
# define clrsrc() printf("\033c")
#endif
__________________
|
|
|
|
|
|
#4 | |
|
Newbie
Join Date: Oct 2005
Posts: 12
Rep Power: 0
![]() |
Quote:
|
|
|
|
|
|
|
#5 |
|
Professional Programmer
|
Try changing void main() to int main() or int main(void) and see if that helps
__________________
The world's first athletic computer geek! The home of PrProgramsStudios How not to post a question: <-- Please don't reply |
|
|
|
|
|
#6 |
|
Newbie
Join Date: Oct 2005
Posts: 12
Rep Power: 0
![]() |
tried that
|
|
|
|
|
|
#7 |
|
Professional Programmer
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4
![]() |
Instead of clrscr(); try typing system("cls");
|
|
|
|
|
|
#8 |
|
Professional Programmer
|
Which version of Turbo C are you using?
__________________
The world's first athletic computer geek! The home of PrProgramsStudios How not to post a question: <-- Please don't reply |
|
|
|
|
|
#9 |
|
Newbie
Join Date: Oct 2005
Posts: 12
Rep Power: 0
![]() |
this is gonna one of iritating things that will get stuck with me ... why dont u guys try to compile it ... i tried on devc that too tell me the same thing
|
|
|
|
|
|
#10 |
|
Newbie
Join Date: Oct 2005
Posts: 12
Rep Power: 0
![]() |
turbo C 3.0
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|