Indeed, I would agree with CommonTater, but time is running up for me, sometimes we have to cope with life, tragic I didn't have the full length of time required to learn C properly.
Type: Posts; User: jimmychauck
Indeed, I would agree with CommonTater, but time is running up for me, sometimes we have to cope with life, tragic I didn't have the full length of time required to learn C properly.
Thankyou everyone for their enthusiasm of helping, unfortunately I am having extreme difficulty with the array operation in C. Was never successful in understanding how array actually functions in C,...
Thanks everyone for the help, however still no luck with the dynamic allocation.
This is the current program
#define TRUE = 1
#include <stdio.h>
#include <math.h>
main()
{ char...
hmm.. yes, but the whole point I am trying to stress here is dynamic. The size of the array is unknown until the first line of the input file is read.
I tried to do
float arraydat[row][col];...
This batch of code I tested, and is working
printf("please enter the number of elements you want to appear in the array: \n");
scanf("%d", &a);
array1 = (float*) malloc(a * sizeof array1);
...
ok, so I think I will try the following
fscanf(fp, "%d, %d", &row, &column) /*to get the number of columns in the array*/
char formatstring[4 * column - 2] /*declare format string array*/
...
Ok, but before I continue, could I know if the fscanf() function takes a string variable as the format argument? Or is there actually string argument in C? or does C treat a character array as a...
I was thinking of reading some data from a file and perform calculation on it. The job has been broken down as follow:
1. welcome message and ask for input filename
2. read header from file that...
Sorry for the confusion caused, now I found what went wrong, when I do #include <math.h>, everything was solved. because I didn't see it in the lib directory I thought it didn't exist, but later I...
Thanks for Adak's and Vincent's reply, I was afraid the packaging was the problem.
For Vincent's info, the code I pasted was a chopped down version of my original program, some parts I chopped off...
Hello everyone, I am a intermediate programmer that had done some programming with PHP, ASP, SQL, Fortran, Matlab and VB and now wanting to learn C.
however I am coming through some very awkward...