Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • Have you tried creating a library like you've done before but not putting any classes in it? Commented Jun 14, 2016 at 20:13
  • 1
    Although this is not directly relevant to your question, sizeof(), like if() is NOT a function (although its syntax looks like one), it is an operator evaluated at compile time. Commented Jun 14, 2016 at 21:05
  • Ok, I was hoping this was possible, I read here that it wasn't possible: stackoverflow.com/questions/1735990/… A few points down the page, someone wrote: > On Arduino you can use classes, but there are a few restrictions: 1. No new and delete keywords 2. No exceptions 3. No libstdc++, hence no standard functions, templates or classes You also need to make new files for your classes, you can't just declare them in your main sketch. You also will need to close the Arduino IDE when recompiling a library. That is why I use Eclipse as my Arduino IDE. No standard Commented Jun 14, 2016 at 21:08
  • No new and delete keywords 2. No exceptions 3. No libstdc++, hence no standard functions, templates or classes - most of that is nonsense. You can use new and delete these days. You can use templates and classes. You can get the STL (standard template library) from StandardCplusplus. You have standard functions like malloc, memcpy, strcpy, etc. Commented Jun 14, 2016 at 22:30
  • You also will need to close the Arduino IDE when recompiling a library - when I am developing a library I use a standalone editor for editing the library. I don't need to close the IDE to test it. Commented Jun 14, 2016 at 22:33