1 Replies - 1784 Views - Last Post: 26 March 2009 - 10:59 AM Rate Topic: -----

#1 samsundar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-March 09

scrolling out put screen

Posted 26 March 2009 - 12:04 AM

i have written code (in turbo c and dev c++) which read setupapi.log file in windows xp. my program is working fine but i can't view the full out put because it is more than the screen size. please help me so that i can scroll the output screen and move around the out put. i don't know which function and code to use for this. please help me. my code is given below.


#include<stdio.h>

#include<conio.h>

#include<stdlib.h>

void main()

{

FILE *fp;

char s[80];

clrscr();

fp=fopen("c:\\windows\\setupapi.log","r");

if(fopen==NULL)

{

puts("cannot open file");

exit(1);

}

while(fgets(s,79,fp)!=NULL)

printf("%s",s);

fclose(fp);

getch();

}



*** MOD EDIT: Added code tags. Please :code: ***

This post has been edited by JackOfAllTrades: 26 March 2009 - 04:29 AM


Is This A Good Question/Topic? 0
  • +

Replies To: scrolling out put screen

#2 Pontus  Icon User is offline

  • Cattlebruiser

Reputation: 18
  • View blog
  • Posts: 612
  • Joined: 28-December 06

Re: scrolling out put screen

Posted 26 March 2009 - 10:59 AM

There's no standard function to make it scroll, and a dos window doesn't support that either. Try to make the output pause after printing out an x-number of lines.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1