Aug 9, 2004 #1 J jaywee03 Newbie level 4 Joined Jul 13, 2004 Messages 7 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 54 functions in c d oes anyone have a code or can you recomend a site were i can find a code that converts a decimal number into its equivalent N base no.(using functions). thanx!!!!
functions in c d oes anyone have a code or can you recomend a site were i can find a code that converts a decimal number into its equivalent N base no.(using functions). thanx!!!!
Aug 9, 2004 #2 C cages Junior Member level 1 Joined Jun 27, 2004 Messages 18 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 167 Re: functions in c Cant realy give a link for this paticular function. but have you tried **broken link removed** have loads of stuff.
Re: functions in c Cant realy give a link for this paticular function. but have you tried **broken link removed** have loads of stuff.
Sep 3, 2004 #3 B brmadhukar Advanced Member level 3 Joined Jun 21, 2002 Messages 839 Helped 42 Reputation 84 Reaction score 11 Trophy points 1,298 Location India Activity points 6,783 Re: functions in c Hi, You have to write your own function. It is quite easy. start with int conv(int base, long num) { rem = num%base. num = num-rem. rem gives the last byte num is divisible base. }
Re: functions in c Hi, You have to write your own function. It is quite easy. start with int conv(int base, long num) { rem = num%base. num = num-rem. rem gives the last byte num is divisible base. }
Nov 18, 2004 #4 J Jackwang Full Member level 2 Joined Nov 12, 2004 Messages 134 Helped 3 Reputation 6 Reaction score 1 Trophy points 1,298 Activity points 1,095 Re: functions in c int convert(int base,long num) { while { B=num%base; num=num/base; c[n]=B; n=n-1; } } n is data length based on some base. B is middle variable. num is data. note: output c is reverse order.
Re: functions in c int convert(int base,long num) { while { B=num%base; num=num/base; c[n]=B; n=n-1; } } n is data length based on some base. B is middle variable. num is data. note: output c is reverse order.