top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

C++ : What is the difference when a function is defined within a class and outside class ?

0 votes
56 views
C++ : What is the difference when a function is defined within a class and outside class ?
posted Aug 19, 2018 by Vikram Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Apart from difference of the syntax for defining functions (methods) within a class and outside class, When you define them within the class, C++ automatically makes them inline without explicitly mentioning it. While outside class definition of function doesn't makes it inline without prefixing with keyword 'inline' before the return type of the method in the header file for class

answer Aug 21, 2018 by 김홍숙
Similar Questions
0 votes

While doing design for a software, what things enforce to use template classes and template functions ?
Is it consider best practices or not ?

+1 vote

When a function is declared as virtual and when a class ? Please explain with examples.

0 votes

Given a Calendar class (there are three fields, year, month, day) and a number of N, Implement a function that returns the calendar after N days.

Example:
Input: {2017, 3,20} and 12,
Output: {2017,4, 1}

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...