Solved

functions in a struct ?

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Socket Programming (Unix) 8 152
SNMP error No Such Object available on this agent at this OID 3 360
sorting efficency of sorting algorithm 30 129
Finding Divisors 5 35
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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 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.

679 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