good point..ive changed it
but i still get en error that says number of argumetns does not match prototype
Type: Posts; User: beginner1
good point..ive changed it
but i still get en error that says number of argumetns does not match prototype
thanks for the help ! i managed to figure out my problem..i started getting confused with my variables i and n and mixed everything up.
so my question relates to 2d arrays. how do i declare one of...
double function(double, double, double);
double aa[N]=a;
double ab[N]=b;
double ac[N]=c;
int
main (int argc, char **argv){
setvbuf(stdout, NULL, _IONBF, 0);
also i tried to change it to double aa[n] ;
but it givesme the problem storage size unknown
ok but since its a global variable, its telling me that a b and c arent declared now
ok so i set aa[N]=a;
ab[N]=b;
ac[N]=c;
is that correct?
but then im not sure how to make it read in the input and point at the variable a, b and c...
double aa[N];
double ab[N];
double ac[N];
int
main (int argc, char **argv){
setvbuf(stdout, NULL, _IONBF, 0);
double a,b,c;
int n=0;
ok so before i pass it into the loop, how would i declare the 3 arrays i need and how can i add pointers ? can i please get an example..
thanks! it worked...i took the g+=f out of the function and into the while loop...now its wokring perfectly...
can anyone now tell me how i can arrays in this program?the number of souces is of no...
double function(double, double, double);
int
main (int argc, char **argv){
setvbuf(stdout, NULL, _IONBF, 0);
double a,b,c;
int n=0;
while(scanf("%lf %lf %lf", &a, &b, &c)==3){...
can u explain to me what the void does and why it is used?
ive read up on it but it still doent make much sense to me
[code]
i was jsut wondering how to pass in an array to a funciton using a pointer. so far i have declared 3 parallel arrays and now i want to pass the elements in the array into a function. would i...
i have another question on arrays
if the program is to scanf and read in values in this form:
30.0 50.4 60.0
40.9 69.9 30.9
...hence
x y z format
thanks for the quick response....however that previous code u gave me is alot more complicated
if i put all of this in a function, how could i declare an array and alter the reading loop ?
is it possible to loop a function so that it scans multiple inputs?
i have written a function but it will only take in the first line of input and nothing after
alright i fixed it and put the printf outside the loop but now its giving me the wrong value
how do i delete a post?
yer i was meant to have the function read out how many loops it is doing aswell...is it possible in the one function? how couldi do this?
what do u mean by' You forgot to actually call hyp_calc in printf. And forward declarations should be outside any functions.'
sorry im new to this
ok so if i wanted to use the result from the function to calculate soemhing else, how would i do this?
and also, i want to printf the data to read it as it does in the function but it only prints...
im writing a function to calculate the hypotenuse of a triangle. the inputs are of no more than 100, but come in as eg.
3.0 4.0
5.0 6.0
7.0 8.0
where the first column is the x distance...
hi everyone,
need some help using parallel arrays
if the user inputs
1 4 5
4 3 3
1 3 5
how can i set up 3 parallel arrays to record these values?
ok so im trying to get my head around all this c stuff..
if i had inputs from a user say...
3 4 5
2 4 7
and i wanted to compute the sqrt of each row summed, plus the number of loops occuring,...