Skip to content

Instantly share code, notes, and snippets.

@dmishe
Created August 5, 2009 23:30
Show Gist options
  • Save dmishe/163042 to your computer and use it in GitHub Desktop.
Save dmishe/163042 to your computer and use it in GitHub Desktop.
#include <iostream>
struct test {
int a;
int a_square();
};
int test::a_square()
{
return a*a;
}
int main()
{
struct test A;
A.a = 123;
std::cout << A.a << std::endl;
std::cout << A.a_square() << std::endl;
getchar();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment