Will any C++ code work?

Discussion in '3DS - Homebrew Development and Emulators' started by Eddypikachu, Oct 20, 2016.

  1. Eddypikachu

    Eddypikachu GBAtemp Advanced Fan

    Mar 25, 2015
    United States
    Hey I'm new to programming and I'm wondering if any code I write C++ wil work on 3ds? Like can I do something as simple as
    std::cout<<"Hello world!"<<std::endl;

    compile it as 3dsx and it would work on 3ds?
  2. elhobbs

    elhobbs GBAtemp Advanced Fan

    Jul 28, 2008
    United States
    Aside from the obvious syntax errors - yes, this would compile. It would not do what you expect though. you would need to add 3ds specific code to initialize one of the screens for console output. And you would probably want to add some code to loop after the cout statement so that you can actually see the output before it closes.
    But will any C++ code work? No, code specific to a different platform will not work. If you are asking if you can use C++ then the answer is yes.
    Eddypikachu likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice