Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

functions in a struct ?

Posted on 2003-10-27
1
Medium Priority
?
223 Views
Last Modified: 2010-04-02
Hi C++ Expert,

   Is that the same to define a function inside and outside a struct definition ? i.e.
------------------------
 struct A{
   int f1(){ return 0;}
   int f2() ;
 };
 int A::f2(){return 0;}
------------------------
what's the difference between f1() and f2() ?? Thanks ........
0
Comment
Question by:meow00
1 Comment
 
LVL 1

Accepted Solution

by:
fsign21 earned 200 total points
ID: 9627982
fi is defined as inline function, f2 not.
Have a look on
http://users.utu.fi/~sisasa/oasis/cppfaq/inline-functions.html#[9.6]
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question