Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
template.cpp
- Committer:
- xenjamo
- Date:
- 2020-03-10
- Revision:
- 0:6e2aac29a2ea
File content as of revision 0:6e2aac29a2ea:
/* class template by clemo this file serves as a guide to creating a cpp class when wirting functions for Easyfit please use this put math, instructions and temporary declarations here declarations that are permanent go in .h file! i never coded c++ lol how to use when creating own class: replace "template.h" with something of your choosing replace class name (EXAMPLE) fckn everywhere write appropriate constructor (EXAMPLE::EXAMPLE) delete any unwanted functions put in your own functions by YOURCLASSNAME::functionname(bla,bla) //same for public and private functions */ #include "template.h" EXAMPLE::EXAMPLE(int _inc, int _start){ this->initvalue = _start; //sets startvalue this->inc = _inc; //sets increment this->useless(); //prints a happy little message } void EXAMPLE::incrementSum(int v1){ for(int i = 0; i < v1; i++){ sum += inc; } } void EXAMPLE::resetSum(void){ sum = 0; } int EXAMPLE::getSum(void){ return sum; } void EXAMPLE::useless(void){ //printf("congrats"); //printf doesnt work :( }