No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hi! I have had to change from Python to C because of university instructions. My problem is that, when I want to make a menu for my program or whatever, I always want to define classes:P My question is simple --> are structures the best way to "replace" classes? TY |
|
OKay... I have a newbie question. [code=c++]#include <stdio.h> class Test{ public: Test(int x); }; int Test::Test(int x=0){ } int main(){ Test test(1); printf("%d", test.x); } [/code] My question is how to make the x variable of the constructor public. I have tried to add : [code=c++] public: int x = … |
|
HI! I have a problem: I want to initalize a class by a condition. For example: [CODE] class something: def __init__(self,a): self.a = a if self.a == 0: #break initalization else: #continue initalization [/CODE] How do I break the initalization? Thank u and sorry for my english! |