im trying to convert VB code to c programming
In the main function it declared as
bool res;
and then they equate it to function
res = array(array 1 ,array2);
is it possible to equate like this
im trying to convert VB code to c programming
In the main function it declared as
bool res;
and then they equate it to function
res = array(array 1 ,array2);
is it possible to equate like this
I do not think C supports boolean types as primitive type.You have to replace it with an int which will have values 0 and 1
Since C99 there is a boolean type in stdbool.h.
Bye, Andreas
Or is it possible to write the array function as
bool array(array1[],array2[])
res = array(array1,array2);
Yes, it is. AndiPersti already gave you a pointer in that direction.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Thank you Andreas.I wasn't aware of that.If someone -for some reason- does not want to use this library then we can construct by his own.
It is possible to have the prototype as
and inside the body of the function to return true,false or a variable which is declared as boolCode:bool array(array1[],array2[]);
(assuming you use the library that Andreas suggested)
Thanks
Well, the prototype should actually be:
where T1 and T2 are the types of the elements of the respective arrays. You may also need a size parameter for each array since you will only be passing a pointer.Code:bool array(T1 array1[], T2 array2[]);
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)