UrbanPro

Learn C++ Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is inline function? Why pointers is not used in C++?

Asked by Last Modified  

Follow 0
Answer

Please enter your answer

MS SQL SERVER DBA Trainer

Inline function is the optimization technique used by the compilers. One can simply prepend inline keyword to function prototype to make a function inline. Inline function instruct compiler to insert complete body of the function wherever that function got used in code. In computer science, a smart...
read more
Inline function is the optimization technique used by the compilers. One can simply prepend inline keyword to function prototype to make a function inline. Inline function instruct compiler to insert complete body of the function wherever that function got used in code. In computer science, a smart pointer is an abstract data type that simulates a pointer while providing additional features, such as automatic garbage collection or bounds checking. These additional features are intended to reduce bugs caused by the misuse of pointers while retaining efficiency. Smart pointers typically keep track of the objects they point to for the purpose of memory management. read less
Comments

16 Yrs of Experience in Teaching

C++ supports pointers. An inline function is function whose complied code is inline with the rest of the program. Inline function run faster than regular functions.
Comments

Inline function instruct compiler to insert complete body of the function wherever that function got used in code. Compiler takes decision. Pointers are used.
Comments

Computer Engineering / Diploma Tutor

Function which replace in the position where it is called is inline function. Their work is similar to macros. We can use Pointers in C++.
Comments

Full-stack Software Trainer with 8+ years of experience

C++ inline function is powerful concept that is commonly used with classes. If a function is inline, the compiler places a copy of the code of that function at each point where the function is called at compile time. In computer science, a smart pointer is an abstract data type that simulates a pointer...
read more
C++ inline function is powerful concept that is commonly used with classes. If a function is inline, the compiler places a copy of the code of that function at each point where the function is called at compile time. In computer science, a smart pointer is an abstract data type that simulates a pointer while providing additional features, such as automatic garbage collection or bounds checking. These additional features are intended to reduce bugs caused by the misuse of pointers while retaining efficiency. Smart pointers typically keep track of the objects they point to for the purpose of memory management. The misuse of pointers is a major source of bugs: the constant allocation, deallocation and referencing that must be performed by a program written using pointers introduces the risk that memory leaks will occur. Smart pointers try to prevent memory leaks by making the resource deallocation automatic: when the pointer (or the last in a series of pointers) to an object is destroyed, for example because it goes out of scope, the pointed object is destroyed too. read less
Comments

Tutor

In a program, If you write a small function which you feel is called again and again, then to reduce the function calls declare that function as inline. By doing we, we request the compiler that "if possible replace the function call with the actual function". Pointers are not used in C++ because...
read more
In a program, If you write a small function which you feel is called again and again, then to reduce the function calls declare that function as inline. By doing we, we request the compiler that "if possible replace the function call with the actual function". Pointers are not used in C++ because we have got a good replacement called as "reference" , which does the same work as that of pointers but in a safe way and less cumbersome code. You need not use the (*) deference symbol everywhere. These are explanation in layman terms. For more details you can refer standard books. read less
Comments

M.tech Computer Science

Function calling has its own over head, and the overhead depends on the Operating system and the processor, But in general any function call is a overhead. So if we are calling a function 2 things are important 1. How big the function is ? 2. How frequently we are calling it ? There is a trade...
read more
Function calling has its own over head, and the overhead depends on the Operating system and the processor, But in general any function call is a overhead. So if we are calling a function 2 things are important 1. How big the function is ? 2. How frequently we are calling it ? There is a trade off, Function calling over head and size of the program. if a small function (with 2-3 lines) is called multiple times then each time function is called (Function calling over head + function code + function return over head ) x N by using inline function , the body of the function gets replaced so the calling and return over head are removed. But the size of the program increases by this "copy of code". Then the question is why not inline all ? yes We can, but if the function body is large and it is called multiple times, each time if we replace the code (copy and paste) then size of the program grows unnecessarily. hope this helps. read less
Comments

Mathematics Tutor

Whenever you call an inline function, the compiler will replace the function call with the function body.
Comments

Software Professional Trainer with 26+ years of Experience in Software Design and Development

Inline function will very useful if your line of code is very less, it will improve the peformance as the function call is not there and cpu cycle consumption will be very less. If the line of code inside the function is more, then inline will not improve the performance. Before compilation, the...
read more
Inline function will very useful if your line of code is very less, it will improve the peformance as the function call is not there and cpu cycle consumption will be very less. If the line of code inside the function is more, then inline will not improve the performance. Before compilation, the inline function call will be replaced with actual code inside the inline function. Pointer is used in C++. If you used the pointer efficiently then program will run fast with limited memory read less
Comments

Perl Developer | Perl Trainer

Inline functions are a lot like a placeholder. Once you define an inline function, using the 'inline' keyword, whenever you call that function the compiler will replace the function call with the actual code from the function. In C++ the emphasis would be on garbage collection and preventing memory...
read more
Inline functions are a lot like a placeholder. Once you define an inline function, using the 'inline' keyword, whenever you call that function the compiler will replace the function call with the actual code from the function. In C++ the emphasis would be on garbage collection and preventing memory leaks (just to name two). Pointers are a fundamental part of the language, so not using them is pretty much impossible except in the most trival of programs. read less
Comments

View 26 more Answers

Related Questions

How to register as teacher?
On the basis of his total experience and Qualification you can do it.
Shrikrishna
How C++ is different from C language?
++ is an increment operator c++ is nothing but adding a new feature to the existing c language. Here, new feature is nothing but object oriented principles.
Tony
What are the benefits of learning C++?
Its a programming language helps to increase dicision making and logic reasoning power
Sunita
What are the toughest topics in C language?
1. pointer 2. dynamic memory allocation 3. File handling
Lokayya
0 0
5
How to create my profile as technology(c++ programming) teacher?
C++ is not a pure OO language by any standards. It is extremely complex and confusing to a beginner to understand it properly. If you know C, you may find the syntax easier -- but if you want to learn...
Nilesh

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Programing Languages Learning Tricks
You want to learn that new language or library or framework as soon as possible, right? That’s understandable. Fortunately, there are a handful of tips that can help you to better retain all of that...

Harshal G.

0 0
0

What Would Be Life Cycle Of A Fresher After Campus In An IT Company?
1. Basic Technical Training: Since freshers are not subject matter experts so gone through 3 - 6 months basic technical training within Organization. 2. Technical Assessment: HR sends freshers to various...

Understanding Computer Science Concepts with Images and Videos..
All Computer science concepts relating to programming and software development are only virtual. It cannot be practically shown as a hardware parts of a computer. But for better understanding it should...

C, C++, JAVA Tutor
* Program to swap two numbers using a temporary variable with each statement explained with comments * #include // headerfile for cout statement using namespace std; //...

Is It Fine To Write “void main()” Or “main()” In C/C++?
The definition: void main() { /* ... */ } Is not and never has been C++, nor has it even been C. See the ISO C++ standard 3.6.1 or the ISO C standard 5.1.2.2.1. A conforming...

Recommended Articles

Introduction C++ is an excellent programming language and many of the applications are written in C++ language. It has generic, object-oriented & imperative programming features, and also provides facilities for low-level memory manipulation. Successor of C language, it is an OOP (object oriented programming) language...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Looking for C++ Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C++ Language Classes?

The best tutors for C++ Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C++ Language with the Best Tutors

The best Tutors for C++ Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more