English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

5 answers

or pass variables into the function "by reference".

Example:

void addonetoboth(int *i, int *j)
{
i++;
j++;
}

int main()
{
int intOne = 0;
int intTwo = 0;
addone(&intOne, &intTwo);

return 0;
}

2007-02-22 13:47:53 · answer #1 · answered by Steve S 2 · 0 0

Both the ways stated above are perfect, depending on situation.
And why you want to convert integers into binary or hexadecimal? The computer presentation of the integers is in binary and in hexadecimal. If you use the different format in printf you will the desire result.

e.g. i = 10;

printf("%d %x",i,i)

will print
10,0xA.

2007-02-22 15:21:13 · answer #2 · answered by manoj Ransing 3 · 0 0

Hex digits convert on to a 4 bit binary form. So A on your celebration is 1010 in case you pick to have zeros in the front of this because your output length dictates it then the output is 00 1010 for 6 bits. in case you pick this technique written for then you i'm sorry yet you're not to any extent further paying me sufficient. have thrilling.

2016-12-04 19:55:55 · answer #3 · answered by Anonymous · 0 0

On the conversion point, it is fairly straightforward,
and can be done in several ways. Random link below
will serve as an example ..


HTH

2007-02-22 14:09:45 · answer #4 · answered by Anonymous · 0 0

You can only return a singe item, but that item can be a structure which has many members.

2007-02-22 13:42:00 · answer #5 · answered by BigRez 6 · 0 0

fedest.com, questions and answers