CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Nov 2018
    Posts
    7

    [RESOLVED] Burnt out. Not sure what I'm doing wrong

    Code:
    Counter
    {
        int counter;
        int counterID;
        int nCounters;
        Counter(int preset);
        void increment();
        void decrement();
        int getValue();
        int getCounterID();
    };
    int Counter::nCounters = 0;
    Counter::Counter(int value)
    {
        counter = value;
        nCounters = nCounters + 1;
        counterID = nCounters;
    }
    void Counter::increment()
    {
        counter++;
    }
    void Counter::decrement()
    {
        counter--;
    }
    int Counter::getValue()
    {
        return counter;
    }
    int Counter::getCounterID()
    {
        return counterID;
    }
    Name:  Screen Shot 2018-12-07 at 2.32.57 AM.jpg
Views: 458
Size:  20.7 KB
    Last edited by 2kaud; December 7th, 2018 at 09:12 AM. Reason: Fixed code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured