Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 27th, 2005, 4:06 PM   #1
farnush
Newbie
 
Join Date: Oct 2005
Posts: 12
Rep Power: 0 farnush is on a distinguished road
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
farnush is offline   Reply With Quote
Old Oct 27th, 2005, 4:08 PM   #2
Narue
Professional Programmer
 
Narue's Avatar
 
Join Date: Sep 2005
Posts: 419
Rep Power: 4 Narue is on a distinguished road
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.
Narue is offline   Reply With Quote
Old Oct 27th, 2005, 4:09 PM   #3
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
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
__________________

tempest is offline   Reply With Quote
Old Oct 27th, 2005, 4:12 PM   #4
farnush
Newbie
 
Join Date: Oct 2005
Posts: 12
Rep Power: 0 farnush is on a distinguished road
Quote:
Originally Posted by tempest
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
i did some other programs only this program where it doesnt work...pissing me off
farnush is offline   Reply With Quote
Old Oct 27th, 2005, 4:22 PM   #5
Prm753
Professional Programmer
 
Prm753's Avatar
 
Join Date: Oct 2005
Location: United States
Posts: 447
Rep Power: 4 Prm753 is on a distinguished road
Send a message via AIM to Prm753 Send a message via MSN to Prm753
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
Prm753 is offline   Reply With Quote
Old Oct 27th, 2005, 4:25 PM   #6
farnush
Newbie
 
Join Date: Oct 2005
Posts: 12
Rep Power: 0 farnush is on a distinguished road
tried that
farnush is offline   Reply With Quote
Old Oct 27th, 2005, 4:27 PM   #7
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4 ivan is on a distinguished road
Instead of clrscr(); try typing system("cls");
ivan is offline   Reply With Quote
Old Oct 27th, 2005, 4:27 PM   #8
Prm753
Professional Programmer
 
Prm753's Avatar
 
Join Date: Oct 2005
Location: United States
Posts: 447
Rep Power: 4 Prm753 is on a distinguished road
Send a message via AIM to Prm753 Send a message via MSN to Prm753
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
Prm753 is offline   Reply With Quote
Old Oct 27th, 2005, 4:28 PM   #9
farnush
Newbie
 
Join Date: Oct 2005
Posts: 12
Rep Power: 0 farnush is on a distinguished road
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
farnush is offline   Reply With Quote
Old Oct 27th, 2005, 4:32 PM   #10
farnush
Newbie
 
Join Date: Oct 2005
Posts: 12
Rep Power: 0 farnush is on a distinguished road
turbo C 3.0
farnush is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:29 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC