C function to display the number of parameters

bckflow Posted messages 496 Status Member -  
 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 answers

  1. nabil07 Posted messages 161 Status Member 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
    1. 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
    2. Dall0o
       
      printf not up to standard =)
      0
    3. TeoJyx
       
      Yop Dall0o, so you’re searching on the internet, huh? :p
      0