Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Count to 10
#7
dante9898 Wrote:This reminded me that i had to look up ways to find how to know when a number is even or odd while making algorithms (And later coding it), and now i remembered how to calculate multiples of any number to boot too Biggrin

Modulo for both?

dante9898 Wrote:Im still fairly new to programing and have to restart my education of it because of a few problems that i won't bother mention, but someone would be nice to explain this to me? "printf( "%d\n", x)" only one that didn't understand exactly what it says (I can guess, sort of, but i would rather know exactly what it is).

C is a low level language, it does not have any natural ways to print values without explicitly casting them into a character string via a format conversion function like printf. The other languages you can just say print @variable and the engine knows to bring the value of the variable, but with C you have to be more specific, because print requires a character string and x is a number, therefore you need to convert x into a character string to print it, either via that function, or a more torturous route such as creating a character array and printing to that array the value of the variable. Could've possibly done a print( itoa(x)); as well.
It's not having what you want - It's wanting what you've got.
Reply


Messages In This Thread
Count to 10 - by Hazzy - 2011-05-22, 11:24 PM
Count to 10 - by Erebus - 2011-05-22, 11:34 PM
Count to 10 - by Hazzy - 2011-05-22, 11:35 PM
Count to 10 - by Eos - 2011-05-22, 11:52 PM
Count to 10 - by FenixR - 2011-05-22, 11:53 PM
Count to 10 - by Kalovale - 2011-05-23, 12:30 AM
Count to 10 - by Eos - 2011-05-23, 12:37 AM
Count to 10 - by shouri - 2011-05-23, 12:45 AM
Count to 10 - by FenixR - 2011-05-23, 12:54 AM
Count to 10 - by Fiel - 2011-05-23, 01:04 AM
Count to 10 - by Hazzy - 2011-05-23, 01:04 AM
Count to 10 - by shouri - 2011-05-23, 01:16 AM
Count to 10 - by Eos - 2011-05-23, 01:21 AM
Count to 10 - by Kalovale - 2011-05-23, 01:25 AM
Count to 10 - by GMSInfighter - 2011-05-23, 01:27 AM
Count to 10 - by Fiel - 2011-05-23, 01:29 AM
Count to 10 - by Luacake - 2011-05-23, 01:34 AM
Count to 10 - by Eos - 2011-05-23, 01:37 AM
Count to 10 - by Fiel - 2011-05-23, 01:39 AM
Count to 10 - by Eos - 2011-05-23, 01:41 AM
Count to 10 - by GMSInfighter - 2011-05-23, 01:49 AM
Count to 10 - by Erebus - 2011-05-23, 01:58 AM
Count to 10 - by shouri - 2011-05-23, 02:06 AM
Count to 10 - by Luacake - 2011-05-23, 02:43 AM
Count to 10 - by Loose - 2011-05-23, 03:51 AM
Count to 10 - by Hazzy - 2011-05-23, 01:59 PM
Count to 10 - by OB3LISK - 2011-05-23, 04:44 PM
Count to 10 - by Nikkey - 2011-05-23, 06:04 PM
Count to 10 - by Shidoshi - 2011-05-23, 06:10 PM
Count to 10 - by Luacake - 2011-05-24, 02:05 AM
Count to 10 - by Stereo - 2011-05-24, 02:37 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)