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

What are the benefits of learning C++?
Its a programming language helps to increase dicision making and logic reasoning power
Sunita
What is Enum
An enumeration is a set of named integer constants. An enumerated type is declared using the enum keyword. C# enumerations are value data type. In other words, enumeration contains its own values and cannot inherit or cannot pass inheritance.
S
How to register as teacher?
On the basis of his total experience and Qualification you can do it.
Shrikrishna
What is the actual size of INT in the C language, 2 or 4 bytes?
The actual size to int is determined by the compiler as the program runs. But theoretically the size is 2 bytes. You can increase the size by adding keyword long infront of it to make the size 4 bytes. Eg int a; // 2 bytes Long int b; // 4 bytes
Kunal
Which language is best, C, C++, Python or Java?
If you want to learn any languages C#, Java, ect. then must to learn C, C++ language as these are base or language to be strong in language skills. C++ is improved version of C language. C#, Java, J# and etc. which are improved version of C++.
Sribaghya
0 0
6

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

Ask a Question

Related Lessons

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...

Object Oriented Programing
Object Oriented Programming Concepts: Object Oriented Programming follows bottom up approach in program design and emphasizes on safety and security of data. Features Of Object Oriented Programming: Inheritance: ...

Upcasting and Downcasting
Converting a derived-class reference or pointer to a base-class reference or pointer is called upcasting. It is always allowed for public inheritance without the need for an explicit type cast. The downcasting,...

Interview Questions
(1) What is the output of below program: For(char i = 0; i<256; i++)Printf(“%d\n”,i); Modify above program so that it can prints number from 0 to 255. (2) Consider on following declaration: (i)...

C and C++ programming with memory level debugging
Understanding C and C++ programming by using memory level debugging. Step 1: Understand the Memory map of C executable Step 2: Start memory level debugging using popular IDE Step 3: Find the memory...

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 >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

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