-
December 29th, 2003, 07:24 PM
#1
Member
C language newb question
i have just started learning assembly and c could anybody please tell some good books on them especially C i am having problem in c i am new here does any body know good thread on AO about C
-
December 29th, 2003, 07:33 PM
#2
Senior Member
Hi
"let us C by yeshvant kanetker" is the best book for newbs starting C
and "IBM PC Assembly Language and Programming by Peter Abel" for assembly
-
December 29th, 2003, 07:41 PM
#3
Member
hi wolverine
i know a bit of C , i am not a absolute newb in C. i want a good book that explains Disk I/O in C
-
December 29th, 2003, 07:47 PM
#4
Senior Member
I think the Book " let us C" is good for both students and advanced programmer alike i always refer to the for C
-
December 29th, 2003, 07:53 PM
#5
Member
could u help me out here i have this school assignment coming could u please explain Disk I/O a bit give example code or something
-
December 29th, 2003, 08:03 PM
#6
I'd advise purchasing/borrowing "The C Programming Language" (Kernighan and Ritchie) otherwise known as the K&R book. It covers I/O for files as well as low-level access in Unix and is *the* C reference book.
-
December 29th, 2003, 08:19 PM
#7
Senior Member
this program will read a file and count how many characters, spaces and newlines are present in a file
[quote]
#include "stdio.h"
void main()
{
FILE *fp;
char ch;
int nol=0, not=0,nos=0,noc=0;
fp=fopen("Test","r");
while(1)
{
ch=fgetc(fp);
if(ch==EOF)
break;
noc++;
if(ch=="")
nob++;
if(ch='\n')
nol++;
if(ch=='\t')
not++;
}
fclose(fp);
printf("\nNumber of characters=%d",noc);
printf("\nNumber of blanks=%d",noc);
printf("\nNumber of tabs=%d",noc);
printf("\nNumber of lines=%d",noc);
}[\quote]
haven't compiled but it should work let me know if it dosen't or u don't understand anything
-
December 29th, 2003, 08:28 PM
#8
Member
Originally posted here by w0lverine
FILE *fp;
what is this FILE
-
December 29th, 2003, 08:34 PM
#9
Senior Member
Originally posted here by neemitjamwal
what is this FILE
before a file could be read or written it must be opened. opening a file establishes a link between the program and the operationg system. the link between our prog and the OS is a structure called FILE which has been defined in the header "stdio.h". we request the OS to open a file and what we get back is a pointer to the structure FILE. that is why we make the following dec.
FILE *fp;
-
December 29th, 2003, 08:54 PM
#10
Member
i can understand the rest of the code except
fp is the file pointer what does fopen() do
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|