thanks man,, i forgottt about that,,, :DD
Type: Posts; User: m_programmer
thanks man,, i forgottt about that,,, :DD
thanks so fixed that and here is my modified code.. but this time,, the read function works perfectly fine but the write function writes " 0.0000 0.0000" every time i run the program...
...
hi everyone.
so i am writing this program that reads some data from a file and store the data into an array of struct then finding the minimum "height" from the array and writing the "height" and...
so i fixed those errors,, but i still get the following outputs for an input file that contains the data:
real 5.5
integer 2
character c
OUTPUT:
Number of Lines: 3
eal 5.500000
Invalid!...
@qny, thanks that worked... but nowww when i run the program with a file like this:
real 5.5
integer 2
character c
i get an output something like this:
Number of Lines: 3
eal 0
Invalid!...
hi,
i have a struct that holds variables of different data types. i am trying to read the first character of data from a data file and store the data into the struct..
the file holds data like...
thank you all,, @salem, the numLines() works fine for me.. it gives me the exact number of lines..
@waltP, closing and opening the file worked,, thanks alot...
I am still getting some random output,, like i mentioned in post #1,,,, please help..!!
if( f != NULL){
lenght = numLine(f);
printf("number of lines : %d\n", lenght);
rewind(f);
fileCommand* fCommand = malloc(sizeof(*fCommand) * lenght);
is...
so i added
rewind(fileNames); before
fclose(fileNames); in the numLines()... but it still outputs something like this..
"number of lines : 5
x7;...
so once i have read until the end of the file using numlines(),, how do i get back to the start of the file??
i am new to c,
so i am writing this function that reads the content a file into an array of struct,, the code compiles perfectly fine but when i run the program it outputs something like this.. ...
anduril462, thank u so much,, i looked at the link u gave,,, they helped me alot,, anddd all those tip were really helpful too...
i found all of the bugs and fixed themm all... thanks again,,
i am writing a function that reads the content of the file into a dynamically-allocated array of "Point" struct.
#include <stdio.h>
#include <stdlib.h>
thanks for the response grumpy..
well i just forgot to include one declaration .
and i did put information about the error messages .. if you look at my code ,, it is commented next to the line...
FIXEDDDD.............!
thanks guys
yeah sorry i forgot to include it here...
node *head = NULL; //declare head
yes, i have read the error messages,, but i cant seem to figure why am i getting those errors.. :((
hi guys... i am having some trouble implementing an insert function for a linked list...
this is my code so far..
//header file
typedef struct{
char *comName;
int comValue;
haha,, thanks guys... i got confused for a second..! :DDD
thank you grumpy.
yes i did include stdlib.h,, i just forgot to paste it in the forum...
now that i fixed that problem, i keep getting the error, ":32: error: 'comName' undeclared (first use in...
hi i am new to c, i keep getting this error. ":32: error: expected expression before ')' token"
here is my code.
typedef struct{
char* name;
int comValue;
}comName;