gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > Questions

#171858 - kevin.evans - Wed Dec 30, 2009 7:27 am

I'm pretty new at C ( started from C# and Java ;/ )... I have a few questions :

- What does the consoleDemoInit(); function do? and is there a different way to write it ( so it's moar pretty? )

- How do you convert an int to a string?

- How do I use c99 mode?

Cheers

edit : I just noticed the beginners section, sorry :/

#171859 - Drovor - Wed Dec 30, 2009 7:52 am

-consoleDemoInit sets up a console that you can write to with printf, not sure what you mean by making it pretty
-you can convert an integer to characters with "itoa" function http://www.cplusplus.com/reference/clibrary/cstdlib/itoa/
-I don't know about c99

#171860 - headspin - Wed Dec 30, 2009 9:00 am

You can add -c99 to CFLAGS in the makefile.

Also I highly recommend you download the source to libnds (http://sourceforge.net/projects/devkitpro/files/) that way you can do a search in the libnds source for "consoleDemoInit" to find out what exactly it does. It's handy for understanding other functions too.

Two links you should also bookmark:

http://libnds.devkitpro.org/
http://nocash.emubase.de/gbatek.htm
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game

#171999 - mog123 - Fri Jan 08, 2010 12:37 am

converting to string is better done using the sprintf function. You can decide on the descriptor yourself and print the number as you like

#172004 - Erik Carrick - Fri Jan 08, 2010 9:20 am

source to libnds would be a great help for you :)
_________________
craft ideas | india news