I got it, I'ill stop reading the file exactly before the end of file...
Nice.... it works....
Type: Posts; User: Tyrant
I got it, I'ill stop reading the file exactly before the end of file...
Nice.... it works....
Ty, i just realised that I used it right before in the same program..., i think i need a nap...
My teacher thougt me it that way, im sorry...
That and fflush(stdin)....
Quick, question, at the very end of my very last function, i do
w = feof(filePtr1)
and then
while(w != 0)
but that dont work, what will feof return if its at the end of the file?
I know
I dont see wher i dont use the variable y.
Ty for the help...
Ok, my brother took the printf line and put it in beetween the File and fileptr = ... lines and now it works....?????
Im using dev-c++ 4.01
How can I tell wich compiler im using?
here are the errors
385 c:\docume~1\andre\mydocu~1\lcc\lab4\refroid\lab4.c
parse error before `*'
386 c:\docume~1\andre\mydocu~1\lcc\lab4\refroid\lab4.c
`filePtr1' undeclared (first use in...
This is the file named refroid.txt that i read from. Here is its content:
0 -1 -2 -3 -4 -5 -10 -15 -20 -25 -30 -35 -40 -45 -50 -55 -60
6 8 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95...
ok...
I was working on my program at school and was able to compile it, now i bring it home on a usb key, try compile it and i get parse error, and filePtr1 undeclared (first use in this function).
I...
Did I do something wrong without knowing it?
I found the answer to my question in my book....:
refroidPtr->mat_tempspeedPtr = (float **) calloc(refroidPtr->num_rows, sizeof (float *));
for(i = 0; i < refroidPtr->num_rows; i++)
...
I fixed my problem thanx to appendix G of my book and a little hard work, here is my new found code:
#include <stdio.h>
#include <stdlib.h>
struct DATA
{
int num_columns;
im not using a data file but if youre speaking of the refroid.txt file its this
-4 -5 -10 -15 -20 -25 -30 -35
15 20 25 30 35 40 45 50
5.35 5.58 6.75 7.91 9.08 10.24 11.41 12.57
6.29 6.55 7.86...
According to my book, calloc takes two arguments, the first for the amount of elements, and the second for the size of one element.
But I dont want to wright (x*y, sizeof(int)) because that would...
Im definently going to try that out but i dont have the time right now...
Im kinda of a beginner so here is what i got so far....
#include <stdio.h>
#include <stdlib.h>
struct DATA
{
int x = 5, y = 6;
float matrix[x][y];
refroidPtr->temp_airPtr = (int *) calloc(refroidPtr->num_columns, sizeof (int));
this is my call to calloc, it creates an array of dimensions refroidPtr->num_columns in the heap where the adresse...
refroidPtr->temp_airPtr = (int *) calloc(refroidPtr->num_columns, sizeof (int));
this is my call to calloc, it creates an array of dimensions refroidPtr->num_columns in the heap where the adresse...
the rest of the members shall now be pointers to arrays in the heap....
This is cool thanx for the help everybody...I think I understand now....
Whats the diffrence beetween calloc and malloc...?
never mind
Ill read on t first....again