fwrite()
fread()
fopen()
fclose()
fseek()
getc()
putc()
fscanf
fprintf
are some ones you should check into. And then there's the ones included in the original language, but not ANSI.
Also check out Open Group's website for info on functions, such as:
http://www.opengroup.org/onlinepubs/...s/stdio.h.html...
User Profile
Collapse
-
Character Arrays in C
I understand simple character arrays; however I do not understand this code example in the K & R book:
...Code:#include <stdio.h> #define MAXLINE 1000 /* maximum input line length */ int getline(char line[], int maxline); void copy(char to[], char from[]); /* print the longest input line */ main() { int len; /* current line length */ -
Well, what I was talking about in the second paragraph is...
For instance in this program, we have fahr (line 16) declared as int. But say for instance, in line 11, if that variable a was a variable of type float. What happens? I really don't understand entering variables as the argument.
I picture it like this, the variable a's value is now stored in fahr, and converted to the type of fahr (if its a different data...Leave a comment:
-
Thanks for the reply friend.
Well, I don't understand functions fully. If I use the return statement to return a variable as type int to a function that is for instance type float, what happens? It is converted? Why do we even declare a function to be any data type? Do we declare them as a data type so that it knows how to store the value the return statement gives it?
Also, I don't understand parameters for functions....Leave a comment:
-
C functions and data types
I guess I don't fully understand the way functions in C work.
For instance, I'll use this program as an example:
...Code:#include <stdio.h> float celsius(int); main() { int a; for(a = 0; a <= 300; ++a) celsius(a); return 0; } float celsius(int fahr) { int a, b;
No activity results to display
Show More
Leave a comment: