Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript Site
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

US Job listings




   Misc

   Amazon

   Links

    


Read data from a file
 

 

 

Description

This opens a file and displays its contents on the screen

Code

/* amethod for displaying the contents of a file
no error checking*/
#include <stdio.h>

void main(void)
{
FILE *fp;
char ch;

fp = fopen("websites.txt","r");
ch = getc(fp);
while(ch!=EOF)
{
putchar(ch);
ch = getc(fp);
}
printf("\n\n");
}

Information

Tested in Visual C++ , LCC Win 32 and Dev C++

 

 

 

 

Download

readafile.txt

websites.txt


 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
start notepad from powershell(Powershell)
a movable target(Darkbasic)
getprotobyname function(PHP)
Is a number odd or even(C Sharp)
open default browser with a url(VB)
Create a directory(VBNet)
text alignment(CSS)
image follows the mouse(VB)

    




Copyright © 2003 by programmershelp.co.uk