what do i do if i don't know the no. of arguments that have to be passed to the function with variable length argument i.e. in the above function what do i do if i want to do away with num completely?
Type: Posts; User: csepraveenkumar
what do i do if i don't know the no. of arguments that have to be passed to the function with variable length argument i.e. in the above function what do i do if i want to do away with num completely?
#include<iostream>
#include<cstdarg>
using namespace std;
double avge(int num,...);
int main(){
double x=avge(2,4.0,6.0);
cout<<x<<endl;
}
double avge(int num,...){
is it possible to initialise a char array separately from where it is declared without using either a for loop or initialising the array character by character?
ok. earlier i did not that int(*)(void *,void*) was actually being used for a cast. thankyou.
how is the pointer to a particular function passed in the following code
qsort((void **)lineptr,0,nlines-1,(int(*)(void*,void*))(numeric?numcmp:strcmp));
is it the normal way to pass a pointer...
thank you for your reply. what you sad can be done. but i am trying to understand what that declaration means.
another important observation. when i do the following initialisation the the warning...
in k&r c the following declaration is given to be pointer to array[13] of int
int (*daytab)[13]
on similar lines i initialize a pointer to array[2]of int in my program as follows
int c[2];...