Solved

functions in a struct ?

Posted on 2003-10-27
1
212 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 50 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now