Skip to main content
gamedev.net
🔒 Locked

Implementing functions in Struct

Started by psae0001 Apr 6, 2005 at 11:33 PM 2 replies 450+ views
Original Post
psae0001
psae0001
Hi, In class we know that we can write :: i.e. class my_class { public: int my_class_function (void) }; int my_class::my_class_function (void) { } --------------------------------------------------- struct my_struct { int my_struct_function (void) }; But how do we do that for struct, if I want to implement a function for struct?
smart_idiot
smart_idiot
Except that members of a struct are public by default, there's no difference.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
Mercury
Mercury
It's the exact same, assuming you're using C++. The only difference between a struct and a class is the default scope. Class is private, where struct is public. Again, assuming you're using C++.

edit: It's annoying being beaten while posting. Damn you smart_idiot, I'll get you back one day...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.