C function to display the number of parameters

bckflow Posted messages 496 Status Membre -  
 TeoJyx -
Hello everyone!

A function that displays a number passed as a parameter. The function should be able to display all possible values in a variable of type int.

For example:
- my_put_nbr(42) displays "42"
- my_put_nbr(0) displays "0"
- my_put_nbr(-42) displays "-42 "

All your suggestions are welcome ;)

--
"Life is like a box of chocolates, you never know what you're gonna get.
Culture is like jam, the less you have the more you spread it."
Configuration: Windows XP Firefox 3.5.3

5 réponses

nabil07 Posted messages 161 Status Membre 64
 
Good evening,

well !!

I don't think it can get simpler than this:

 void my_put_nb(int var){ printf("%d\n", &var); } 
2
loupius
 
If there is an easier way:<code>void my_put_nb(int var){
printf("%d\n",var);
}</code>Attention is watching us ;-)
Good evening.
0
Dall0o
 
printf not up to standard =)
0
TeoJyx
 
Yop Dall0o, so you’re searching on the internet, huh? :p
0