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


Dear Students! Share your Assignments / GDBs files as you receive in your LMS, So it can be discussed/solved timely. Files Upload Here.

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

+ Iuuoɔǝut + posted discussions
39 minutes ago
彡JK彡 ❤️ replied to Aijaz khan's discussion CS510 Assignment Fall 2019 Need Solution
2 hours ago
彡JK彡 ❤️ liked Aijaz khan's discussion CS510 Assignment Fall 2019 Need Solution
2 hours ago
Aijaz khan posted a discussion
4 hours ago
HaMza Tufail added a discussion to the group CS519 Final Project
5 hours ago
HaMza Tufail joined + M.Tariq Malik's group
6 hours ago
Fatima joined + M.Tariq Malik's group
7 hours ago
Adnan Hafeez replied to MIT's discussion Visual Programing (CS411) Assignment#01 Deadline Date = 18-11-2019 in the group CS411 Visual Programming
7 hours ago
Shine--Ex-VUStudent liked ١ دن's discussion زندگی گزارنے کا فارمولا
7 hours ago
HaMza Tufail added a discussion to the group CS420 Web Development for Portable Devices
8 hours ago
HaMza Tufail updated their profile
8 hours ago
١ دن replied to + Iuuoɔǝut +'s discussion بعد مُدت اُسے دیکھا، لوگو
8 hours ago
HaMza Tufail joined + M.Tariq Malik's group
8 hours ago
Biya liked + Iuuoɔǝut +'s discussion بعد مُدت اُسے دیکھا، لوگو
9 hours ago
Biya liked UMER UMER's discussion images111.jpg
9 hours ago
Biya liked ١ دن's discussion زندگی گزارنے کا فارمولا
9 hours ago
Profile IconFatima, HaMza Tufail, Mahnoor shahid and 7 more joined Virtual University of Pakistan
9 hours ago
+ M.Tariq Malik liked ١ دن's discussion زندگی گزارنے کا فارمولا
9 hours ago
١ دن posted a discussion
9 hours ago
Amina Ibrahim joined + M.Tariq Malik's group
9 hours ago

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

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