Ok. Esbo I had had that idea but wasn't sure how to do it. Thanks.
Type: Posts; User: drty2
Ok. Esbo I had had that idea but wasn't sure how to do it. Thanks.
My instructor said I wasn't allowed to use a structure as we hadn't been taught it yet. So how am I supposed to read this from a file into an array?
It's set out like this
M 40 6
F 21 2
F 61...
oh lol thanks
All my calculations are coming up under the Female columns. They're in the correct age and lead type, but all the males are being calculated as females! What am I doing wrong?
#include...
oh i forgot the record before rec[] lol, thanks
I read about passing arrays to functions and created this code but I get errors. On the read_file(rec); line I get "error: cannot convert 'record*' to 'rec' for argument '1' to 'void...
This is the code I have... how do I make it so I can access the info in the read_file function in my print_report function?
#include <stdio.h>
#define MAXRECORDS 4
struct record
{
char...
Awesome thanks, work's now :-)
Ok how would I stop it reading in the newline character?
This is the code I have. To check my struct I put in a printf function and instead of returning
M 60 2
F 42 1
F 12 4
M 26 3
it's returning
F 12 4
1986850018 8M 26 3
0 0
I don't have a compiler at home so haven't been able to test the code yet.
So now say that it does work and all the information is in the struct. How would I collate the data for the report?
Would this be ok?
#include <stdio.h>
#define MAXRECORDS 4
struct record
{
char gender;
int age;
Ok I just started to write some code and so far have:
#include <stdio.h>
void readfile();
void main()
{
readfile();
Ok so I have it in a structure... I'm unsure of how to compute the data. There's 36 different groups in the report and the only thing I can think of right now is using an If...else statement but...
I've attached the project details in a word document.
I'm trying to write the solution algorithm only in pseudo code at the moment before I write the actual code but am pretty stuck. I know I...