exit(100);
Type: Posts; User: Sorinx
exit(100);
Alright I'm done, thanks!
Ok I think I got it. Talking to myself is doing wonders for some reason
#include <stdio.h>
#include <malloc.h>
#define CLASS 2
#define STUDENT 2
#define GRADE 2
I know for a fact it works, my semicolon comments were from your actual code, you would have to enter it in as 2 2 from what you typed as Salem said. You need to just break them into two different...
#include <stdio.h>
int main()
{
int base, cat;
long int value=1;
printf("Enter the base number and exponent: ");
scanf("%d", &base);
scanf("%d", &cat);
while (cat!=0)
{
Same lines different error. not sure what I'm mistaking
you have a semi colon after your while loop, while loop never executes
while(power!=0) then you have this semicolon, can't do that, delete it and you're good
change the name of exp, also your printf statement should be
printf("%d", value);
I don't think your using continue and break how you think
while(number!=0){
if(r>0){
a=area_Circle(int a, int r);
printf("The area is %f\n", a);
}
else
etc etc.
Ok I made some dumb errors I fixed them but the error is still in those 2 lines
#include <stdio.h>
#include <stdlib.h>
#define CLASS 4
#define STUDENT 11
#define GRADE 5
Supposed to malloc an array, populate it then pass only parts of it to the functions to get the averages needed.
#include <stdio.h>
#include <stdlib.h>
#define CLASS 4
#define STUDENT 11
#define GRADE 5
float average(float ***grade);//functionprototypes
void classAverage(float *grade);
void freeArray(int ***a) {
int i,j;
for(i = 0; i <=NUMBER_OF_STUDETS; i++){
for(j = 0; j <= NUMBER_OF_CLASSES; j++){
free(a[i][j]);
}
free(a[i]);
}
free(a);
Nah just commenting on my own stupidity, but I'm literally falling asleep, looking at free function now. never did much with malloc prior
Lol, wow is all I can say. I know better than this
Ahh yes, I noticed that and changed it, I can enter the inputs, but then afterwards it crashes.
Bare with me I'm a bit over tired, why am I out of bounds?
Ahh sorry, I edit it in main, whenever I respond about the changes!
Thanks I missed that semi colon, it's early and my spacing is horrid atm, bad habits. Still same result however
I'm not that good but I wrote this real quick trying to figure out why mine is crashing
#include <stdio.h>
#include <conio.h>
int main()
{
Ok I wrote a function to free my memory, and I won't cast it in the future. Trying to figure out what I am doing wrong
what should I do instead of casting malloc?
Just crashes when I try and run
Clearly I'm not doing this right, what am I missing?
/* printing the average grade for every student in every class.
printing out the average grade per class; printing out the average grade...
Oh man I didn't even notice that little oversight, thank you