We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More

Many programming languages have no concept of Pointers. Do you think that Pointers feature of C++ makes it more complicated language? Give your answer with reason.

Note 1:- Keep your comments brief and to the point(Maximum 150 Words)
Note 2:- GDB will not be accepted via email in any case.

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 1690

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Replies to This Discussion

GDB of cs304

Many programming languages have no concept of Pointers. Do you think that Pointers feature of C++ makes it more complicated language? Give your answer with reason.

 

Note 1:- Keep your comments brief and to the point(Maximum 150 Words)

Note 2:- GDB will not be accepted via email in any case.

Lets start discussion friends

Please Discuss here about this GDB.Thanks

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.

 

GDB cs 304

Pointers are immensely powerful in that there is greater control of object existence and one is able to manually control the scope of variables through the use of the heap. I also acknowledge that lack of proficiency therein leads to memory leaks.

Pointers allow the use of non contiguous data structures. If pointers did not exist then data structures would have to store all elements contiguously in memory and inserting an element into the middle of the data structure would become expensive as whole chains of data would have to be copied, a new value placed where the new element is added and the old sequence would have to be pasted into the data structure again. How expensive! Pointers allow easy manipulation of data structures and introduce efficiency into manipulation of data structures. A simple example is the linked list, removing and inserting nodes(using pointers and is efficient) therein and inserting into the end of the list, which is slightly more expensive as one has to deal with a null pointer. 

Pointers allow for greater flexibility, like an array is just a pointer to a block of memory, meaning manipulating this can be expensive. Once you know this you also know that this is a constant block of memory meaning to increase it one has to copy the entire block, create a new, larger block of memory and paste the previously copied values. When you know this at pointer level you will understand not just an array is inefficient but you will know why an array in a poor choice of data structure.

Pointers give us control when we perform computation we can compute and decide to leave the original master structure unchanged (preserving the master data) thereby allowing a copy or just reference the address in memory and avoid the copy.

A knowledge of pointers allows one to accurately design efficient classes. If I have a pointer as a data member in a template class, then I know that I have to specify my own big 5, and I cant just use the default constructors and destructors, if I don't do this Ill end up with a shallow copy of the data member with all my pointer data members pointing to the same object. Pointers allow you to understand deep copy semantics and this is an important part of C++11.

This allows you to build on to further topics like move semantics in which you will understand whether a copy constructor or a move constructor  was invoked based on whether the object is an lvalue or rvalue. This is important if you wish to be an efficient C++11 programmer. A correct understanding and use of move constructors, move assignment operator and copy constructors is required to be an efficient C++11 programmer. 

Pointers are important and one has to have a good grasp of them in order to understand.

agr itna lamba answer ho to marks km milte hen

Pointers allow the use of non contiguous data structures. If pointers did not exist then data structures would have to store all elements contiguously in memory and inserting an element into the middle of the data structure would become expensive as whole chains of data would have to be copied, a new value placed where the new element is added and the old sequence would have to be pasted into the data structure again. How expensive! Pointers allow easy manipulation of data structures and introduce efficiency into manipulation of data structures. A simple example is the linked list, removing and inserting nodes(using pointers and is efficient) therein and inserting into the end of the list, which is slightly more expensive as one has to deal with a null pointer. 

Pointers allow for greater flexibility, like an array is just a pointer to a block of memory, meaning manipulating this can be expensive. Once you know this you also know that this is a constant block of memory meaning to increase it one has to copy the entire block, create a new, larger block of memory and paste the previously copied values. When you know this at pointer level you will understand not just an array is inefficient but you will know why an array in a poor choice of data structure.

 If I have a pointer as a data member in a template class, then I know that I have to specify my own big 5, and I cant just use the default constructors and destructors, if I don't do this Ill end up with a shallow copy of the data member with all my pointer data members pointing to the same object. Pointers allow you to understand deep copy semantics and this is an important part of C++11.

Pointers give us control when we perform computation we can compute and decide to leave the original master structure unchanged (preserving the master data) thereby allowing a copy or just reference the address in memory and avoid the copy.

A knowledge of pointers allows one to accurately design efficient classes.

A knowledge of pointers allows one to accurately design efficient classes. If I have a pointer as a data member in a template class, then I know that I have to specify my own big 5, and I cant just use the default constructors and destructors, if I don't do this will end up with a shallow copy of the data member with all my pointer data members pointing to the same object.

This allows you to build on to further topics like move semantics in which you will understand whether a copy constructor or a move constructor  was invoked based on whether the object is an lvalue or rvalue. This is important if you wish to be an efficient C++ programmer. A correct understanding and use of move constructors, move assignment operator and copy constructors is required to be an efficient C++ programmer.

Dear Students Don’t wait for solution post your problems here and discuss ... after discussion a perfect solution will come in a result. So, Start it now, replies here give your comments according to your knowledge and understandings....

USE OF POINTERS IN A PROGRAMMING LANGUAGE
Pointers have tremendous power but the power can swing both sides good and evil. Many new programming languages pretend not to use pointers with objects, like Java, .NET, Delphi, Vala, PHP, Scala. But, pointers are still used, "behind the scenes". 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 trivial of programs.
Advantages:
• can return more than 1 value from a function
• no need to pass the entire object to a function..can pass just the address
• if we want our object to be modify by some function then we have only option to pass its address or reference
• can implement run time polymorphism(virtual...function)
• in writing driver .....pointer is needed....also can do programming at low level
• can implement garbage collection thing like reference counting
• if want to share some object among classes we can have the pointer of that object
• in each interested classes

Disadvantages:
* Pointer if used incorrectly leads to very difficult to unearth bugs which will most probably make you go wild.
* Pointers are itself are not any trouble but the value they are storing can be.
* If it contains a incorrect value it can lead to disasters of massive magnitude when used.
* when you use this incorrect pointer to write a memory location you may be writing a unknown memory location.
* The bugs and errors created by the pointers may not show up immediately but come up later and it is at that time difficult to predict that it was the pointer to blamed.

Yet, pointers are still utilized, "in the background". In C++ the accentuation would be on junk accumulation and avoiding memory releases (just to name two). Pointers are a major piece of the dialect, so not utilizing them is essentially inconceivable aside from in the most trial of projects.

RSS

Latest Activity

Mezab-E-Rehmat liked + Iuuoɔǝut +'s discussion ENG101-Midterm -MCQS- and Subjective Solved With-References By Moaaz 2011
16 seconds ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion MTH631 - Real Analysis II Assignment No 01 Fall 2019 Solution & Discussion in the group MTH631 - Real Analysis II
5 minutes ago
+ M.Tariq Malik liked + M.Tariq Malik's discussion MTH631 - Real Analysis II Assignment No 01 Fall 2019 Solution & Discussion
5 minutes ago
+ M.Tariq Malik added a discussion to the group MTH631 - Real Analysis II
5 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion PSY101 Introduction to Psychology Assignment No 01 Fall 2019 Solution & Discussion in the group PSY101 Introduction to Psychology
7 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion BNK601 Banking Laws & Practices GDB Fall 2019 Solution & Discussion in the group BNK601 Banking Laws & Practices
10 minutes ago
+ M.Tariq Malik liked + M.Tariq Malik's discussion BNK601 Banking Laws & Practices GDB Fall 2019 Solution & Discussion
10 minutes ago
+ M.Tariq Malik added a discussion to the group BNK601 Banking Laws & Practices
11 minutes ago
+ "J ɨ y ą ⋆ updated their profile
12 minutes ago
+ M.Tariq Malik replied to MIT's discussion Visual Programing (CS411) Assignment#01 Deadline Date = 18-11-2019 in the group CS411 Visual Programming
13 minutes ago
+ "J ɨ y ą ⋆ replied to + "J ɨ y ą ⋆'s discussion Mohabat
14 minutes ago
+ "J ɨ y ą ⋆ replied to + "J ɨ y ą ⋆'s discussion Hona chahy tha.......
17 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion MTH101 Calculus And Analytical Geometry Online Quiz No 01 Fall 2019 Solution Discussion in the group MTH101 Calculus And Analytical Geometry
22 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion MTH101 Calculus And Analytical Geometry Online Quiz No 01 Fall 2019 Solution Discussion in the group MTH101 Calculus And Analytical Geometry
25 minutes ago
+ M.Tariq Malik liked + M.Tariq Malik's discussion MTH101 Calculus And Analytical Geometry Online Quiz No 01 Fall 2019 Solution Discussion
25 minutes ago
+ M.Tariq Malik added a discussion to the group MTH101 Calculus And Analytical Geometry
26 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion CS401 Assignment No 01 Fall 2019 Solution & Discussion in the group CS401 Computer Architecture and Assembly Language Programming
31 minutes ago
+ M.Tariq Malik replied to مخلص's discussion Oppo Reno Ace. Tip Toward Balance.
34 minutes ago
Areeha Chuhdary liked + ! ! ! ! ! ! ! Ayesha +++'s blog post some suggestions of Hazrat Muhammad (PBUH)
35 minutes ago
+ M.Tariq Malik liked مخلص's discussion Oppo Reno Ace. Tip Toward Balance.
37 minutes ago

© 2019   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service