Writing C++ code without arduino IDE.
A few questions.
Does everything work the same? Do I need void setups() and loops()?
I was using this website called codewars, the task was to make a function, that transforms Int to String.
Im wondering, why Is there a #include <string>?
the code:
#include <string>
std::string number_to_string(int num) {
// your code here
}
thanks!
2 Replies
c++ outside arduino ide is fairly different, you don't have setup or loop functions but u do have int main() { return 0;}. the main function is where the code is ran but functions can still be declared outside of it so that they're public, I'm writing this all from memory so forgive me if some of this is wrong
nevermind didn't read your full question my bad, string.h is a library that you have to import as strings are handled differently in arduino ide as why you don't need to import it when using arduino ide I think, not really sure why
okay thanks