c - Header files and functions, is my function, parameters, or header prototype? -
i started c , tasked using header house prototype function. problem nothing happens when i'm expecting prompt input. didn't error , know @ first solve problem. have far.
lab2.c
#include <stdio.h> #include "lab2header.h" int main(){ double *p; double array [10]; p = array; const int size = 10; void input(p,size); return 0; }
lab2header.h
#ifndef lab2header_h_ #define lab2header_h_ void input (double *array,const int size); #endif
lab2header.c
#include <stdio.h> #include "lab2header.h" void input (double *array,const int size){ (int = 0; < size ; i++) { printf("input value"); scanf("%lf", &array[i]); } }
a lot of notes @ seem either use int parameter or have function no needed parameters, mistake in array pointer problem way made function?
void input(p,size);
this line makes no sense. if supposed function call, need remove void
.
Comments
Post a Comment