Using a class function in int main()

前端 未结 6 977
悲哀的现实
悲哀的现实 2020-12-20 09:49

I am having problems calling my functions from my main program.
These functions HAVE to be in my class.
How do I access them from my int main()?

#inc         


        
6条回答
  •  被撕碎了的回忆
    2020-12-20 10:09

    You are calling class methods as just waitSemaphore without creating the object of myCountingSemaphoreUsingBinarySemaphore.

    You should create the object first.

    myCountingSemaphoreUsingBinarySemaphore obj;
    obj.waitSemaphore(mutex1);
    

提交回复
热议问题