RSS Forums RSS

mixed up

Please support our C advertiser: Programming Forums
Reply
Posts: 10
Reputation: xlx16 is an unknown quantity at this point 
Solved Threads: 0
xlx16 xlx16 is offline Offline
Newbie Poster

mixed up

  #1  
Nov 19th, 2008
when i wrote the following program in turbo c,the out put was right but when i wroted it in
borland c,the out put was wrong and the (*) was printed in wrong place,so what is the problem with
borland c for dos.for another example i wrote a program which contained some graphical features
compilers couldent compile it ,exept borland c for dos(even borland c for windows coulden`t compile
it,an error about bgi and windows ...?! happend).
  1. #include <stdio.h>
  2. #include <conio.h>
  3. int main(){
  4. clrscr();
  5.  
  6. gotoxy(50,20);//one
  7. printf("*");
  8.  
  9. gotoxy(0,0);//two
  10. printf("*");
  11.  
  12. getch();
  13. return 0;
  14. }
by the way i have an other question:
can u please brif me on bgi api (16- bit 32- bit os) or name some good web sites about it?
Last edited by Narue : Nov 19th, 2008 at 9:23 am. Reason: added code tags, do it yourself from now on or I'll start infracting you for rule violations
AddThis Social Bookmark Button
Reply With Quote  
Posts: 2,362
Reputation: niek_e has much to be proud of niek_e has much to be proud of niek_e has much to be proud of niek_e has much to be proud of niek_e has much to be proud of niek_e has much to be proud of niek_e has much to be proud of niek_e has much to be proud of niek_e has much to be proud of niek_e has much to be proud of 
Solved Threads: 257
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Nearly a Posting Maven

Re: mixed up

  #2  
Nov 19th, 2008
gotoxy() is a function developed by Borland for Turbo C. It was never standard C to begin with, so to get your program back to standards and up to date, try using: SetConsoleCursorPosition()
Here's another usefull link

other things that are non-standard in your program are:
#include <conio.h> Just delete it
clrscr(); Click here for alternatives
getch(); . Use getchar(); instead if you're just using it to pause the program
Want better/more replies to your questions? Wrap your code in [code] [/code] tags!
Reply With Quote  
Posts: 13,883
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1231
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: mixed up

  #3  
Nov 20th, 2008
for another example i wrote a program which contained some graphical features
compilers couldent compile it ,exept borland c for dos(even borland c for windows coulden`t compile

As you found out the hard way, attempting to port programs written with ancient Turbo C is pretty tedious -- usually requires 100% rewrite of everything used from dos.h and graphics.h
Reply With Quote  
Posts: 82
Reputation: ajay.krish123 is an unknown quantity at this point 
Solved Threads: 6
ajay.krish123 ajay.krish123 is offline Offline
Junior Poster in Training

Re: mixed up

  #4  
Nov 20th, 2008
gototxy(); function might not be defined in your header file or it might be the problem with the compiler
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 287 | Replies: 3 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:48 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC