Pages

Monday, May 18, 2015

Update of 18.05.2015

Well, started to code the random thingy using OOP. Never been good at that.
From days of messing with AngularJS (MVC framework):

"
Error log:
       [$injector:modulerr] http://errors.angularjs.org/1.2.20/$injector/
       modulerr?p0=routeApp&p1=Error%…dflare.com%2Fajax%2Flibs%2Fangular.js%2F1.2.20%2Fangular.min.js%3A18%3A139
       


       Triple checked. No errors in wrong coding. Angular just being a straight up a B*tch.
"

And now C++...

"
C:\Users\User\AppData\Local\Temp\build1411341365459657781.tmp\random.h:31:42: error: ISO C++ forbids declaration of 'Randomize' with no type [-fpermissive]
 Random::Randomize(int IN_pin, int OUT_pin) {
                                          ^
C:\Users\User\AppData\Local\Temp\build1411341365459657781.tmp\random.h: In member function 'void Random::begin()':
C:\Users\User\AppData\Local\Temp\build1411341365459657781.tmp\random.h:52:23: error: a function-definition is not allowed here before '{' token
   void Random::stop() {
                       ^
main.ino:10:1: error: expected '}' at end of input
expected '}' at end of input
"

... (sighs) ... Let's be honest, I haven't got the single slightest clue what the f*ck i'm doing.



4 comments:

  1. Class constructor must have class' name.
    It thinks Randomize is a regular function and thus expects a return type .. which it can't find.

    ReplyDelete
    Replies
    1. So, what i'm understanding is Random::Random ? (tests) Ah, I see. That fixed everything. ... wait, so does that mean I can't make multiple constructors under one object?

      Delete
  2. You can, but they have to be with different arguments.

    ReplyDelete
    Replies
    1. Err .. different number of arguments or different argument types.

      Delete