This blog is under construction

Saturday, 5 October 2013

Advantages and disadvantages of pointers in c

Benefits(use) of pointers in c:

  • Pointers provide direct access to memory
  • Pointers provide a way to return more than one value to the functions
  • Reduces the storage space and complexity of the program
  • Reduces the execution time of the program
  • Provides an alternate way to access array elements
  • Pointers can be used to pass information back and forth between the calling function and called function.
  • Pointers allows us to perform dynamic memory allocation and deallocation.
  • Pointers helps us to build complex data structures like linked list, stack, queues, trees, graphs etc.
  • Pointers allows us to resize the dynamically allocated memory block.
  • Addresses of objects can be extracted using pointers

Drawbacks of pointers in c:
  • Uninitialized pointers might cause segmentation fault.
  • Dynamically allocated block needs to be freed explicitly.  Otherwise, it would lead to memory leak.
  • Pointers are slower than normal variables.
  • If pointers are updated with incorrect values, it might lead to memory corruption.
Basically, pointer bugs are difficult to debug.  Its programmers responsibility to use pointers effectively and correctly.

111 comments:

  1. This content is very much helpful for me.. Thank you :)

    ReplyDelete
  2. I have a doubt. As mentioned in the dis-adv if the Pointer are slower than the normal variables then how can they reduce the execution time ?

    Pardon me if the doubt is lame. I am new to C Language.

    ReplyDelete
    Replies
    1. i too have the same doubt.

      Delete
    2. I to have the same dought.can anyone explain

      Delete
    3. As pointers are the complex user defined data types they take lot more time for compile and execution time.

      Delete
    4. they are slow in accesing but fast in execution

      Delete
    5. Normal varuiables are faster while just accessing. But if you call a function with that variable or data structure, it need to copy the value and sent it there.
      But in pointer, we only share the pointer address not a full value. so it will save time and memory. for larger programs pointers save lot of time.

      Delete
    6. Pointers holds address of a variable rather a variable itself so it is slow. While execution ( Call by value) operation is performed directly on a variable rather than on a copy of a variable so it reduces the execution speed.

      Delete
    7. While handling large data,normal variables take more time to allocate whereas pointers are faster when handling large searching or sorting

      Delete
  3. Thank you 😊 soooo much

    ReplyDelete
  4. Really an great help.....
    & i like your blogspot name "see programming" :)

    ReplyDelete
  5. Yes, I have the same view with "Unknown".Could you explain to us, how pointer can reduce the execution time. Im new also in programming c

    ReplyDelete
  6. Yes, I have the same view with "Unknown".Could you explain to us, how pointer can reduce the execution time. Im new also in programming c

    ReplyDelete
  7. I have the same doubt regarding to execution time reduction because of pointer.

    ReplyDelete
    Replies
    1. Hey
      Because pointer hits the location or address of a variable so execution speed is fast.
      And maybe pointer takes address slowly in compare of normal variable takes value so pointer is slower than normal variable

      Delete
    2. Hey
      Because pointer hits the location or address of a variable so execution speed is fast.
      And maybe pointer takes address slowly in compare of normal variable takes value so pointer is slower than normal variable

      Delete
  8. how can i insert unlimited records in programms of c++ using pointer and array

    ReplyDelete
  9. Even I have the same doubt as unknow have.........

    ReplyDelete
  10. because it's a indirect access to the variable so it's slower then normal variable

    ReplyDelete
  11. How to implement linklist,tree and graph without Pointer?

    ReplyDelete
  12. Thank you much.this is very helpful.

    ReplyDelete
  13. Thank you much.this is very helpful.

    ReplyDelete
  14. Main drawback of pointer is it doesn't provides security. That's y pointers are committed in oops

    ReplyDelete
  15. Main drawback of pointer is it doesn't provides security. That's y pointers are committed in oops

    ReplyDelete
  16. Replies
    1. hii archana do u any certificates of online course

      Delete
  17. let us assume the chess board as memory,give the numbers from 0 to 63 in boxes of board.assume each box as 1 byte,now you declare the int pointer variable it will take 4 bytes,it occupies the address from 0 th box to 3 rd box,so the address of the integer variable is 0-3.similarly for every variable we have a particular address.this will provide to access memory easily and through address we can easily find the location reach destination fastly, similarly here also execution will take less time,just image these things in real world you will get an idea.

    ReplyDelete
  18. Thanks admin can u share your email id with me

    ReplyDelete
  19. Really, these quotes are the holistic approach toward mindfulness. In fact, all of your posts are. Proudly saying I’m getting fruitfulness out of what you write and share. Thank you so much..
    Devops Training in Bangalore
    R Programming Training in Bangalore

    ReplyDelete
  20. @ Very nice blog. You can also find C, C++, Java programming tutorial at BestBCANotes.com

    ReplyDelete
  21. This comment has been removed by the author.

    ReplyDelete
  22. what is the difference b/w pointer as function argument & pointer to function?

    ReplyDelete
  23. You truly did more than visitors’ expectations. Thank you for rendering these helpful, trusted, edifying and also cool thoughts on the topic to Kate.
    big-data-hadoop-training-institute-in-bangalore

    ReplyDelete
  24. I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.
    Python Training in Bangalore

    ReplyDelete
  25. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here. Best AWS Training in Bangalore

    ReplyDelete
  26. It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.

    AWS Training in Bangalore
    Python Training in Bangalore

    ReplyDelete
  27. It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.

    Digital Marketing Training in Bangalore

    ReplyDelete
  28. Needed to compose one simple word yet thanks for the suggestions that you are contributed here, please do keep updating us...
    C Language Training | C Language Online Training

    ReplyDelete
  29. Your blog was very interesting & easy to understand. Thank you so much sharing that valuable blog.... Duplicate Payment Audit
    Continuous Monitoring
    Internal Audit

    ReplyDelete
  30. Sap fico training institute in Noida

    Sap fico training institute in Noida - Webtrackker Technology is IT Company which is providing the web designing, development, mobile application, and sap installation, digital marketing service in Noida, India and out of India. Webtrackker is also providing the sap fico training in Noida with working trainers.


    WEBTRACKKER TECHNOLOGY (P) LTD.
    C - 67, sector- 63, Noida, India.
    F -1 Sector 3 (Near Sector 16 metro station) Noida, India.

    +91 - 8802820025
    0120-433-0760
    0120-4204716
    EMAIL: info@webtrackker.com
    Website: www.webtrackker.com

    ReplyDelete
  31. Thanks For Sharing Your Information Please Keep UpDating Us Time Just Went On Reading The article The Information shared Is Very Helpful
    Datascience Online Training Aws Online Training Python Online Training Devops Online Training

    ReplyDelete
  32. This comment has been removed by the author.

    ReplyDelete
  33. That is a really good way .... For learning...or for understanding the pointers it is very helpful

    ReplyDelete
  34. Dell Laptop Repair Center in Noida is no.1 service center which provides door to door services in or its nearby areas. We have expert, technicians who can repair your laptop at your home. . Call us: 9891868324

    ReplyDelete


  35. That is nice article from you , this is informative stuff . Hope more articles from you . I also want to share some information about Pet Dermatology in Vizag

    ReplyDelete
  36. Become a data science expert by joining AI Patasala’s Data Science Training in Hyderabad, where you can learn more advanced data science topics with real-time experience. AI Patasala offers both online and offline classroom training sessions for data science aspirants. After completion of the course you will receive industry recognized certification, which will help you get a data science job in top MNCs.
    Data Science Training Institutes in Hyderabad

    ReplyDelete
  37. I appreciate this piece of useful information,Thank You Online Sweets Delivery in Hyderabad

    ReplyDelete
  38. great post with useful information. check out this link to read more informative blogs about AI service desk at MS team which will change the employee experience in your organisations.

    ReplyDelete
  39. great post with useful information. check out this link to read more informative blogs about AI service desk at MS team which will change the employee experience in your organisations. click here : https://bit.ly/3Ju9Apc

    ReplyDelete
  40. wow! very nice article. who want to learn online course visits: Apttus Course Online

    ReplyDelete
  41. This post is usefull and informative.Keep Updating with more infomration...
    German Classes In Bangalore
    German Language Course In Bangalore

    ReplyDelete
  42. This post is so useful and informative keep updating with more information.....
    Data Science Courses in Bangalore
    Data Science Training in Bangalore

    ReplyDelete
  43. Enroll in the Data Science course near me to learn the handling of huge amounts of data by analyzing it with the help of analytical tools. This field offers ample job profiles to work as a Data Architect, Data Administrator, Data Analyst, Business Analyst, Data Manager, and BI Manager. Step into an exciting career in the field of Data Science and achieve great heights by acquiring the right knowledge and skills to formulate solutions to business problems.

    Data Science Course in Bangalore with Placement

    ReplyDelete
  44. This post is so useful and informative keep updating with more information.....
    bankruptcy lawers near me
    bancruptcy lawyer near me

    ReplyDelete
  45. Nice post , Thanks For sharing great info . if do you want best digital marketing service , then Levitadz is the best Indian Digital Marketing Agency for all your Internet Marketing needs. Contact us today for more details.

    ReplyDelete
  46. we are giving online IT and non IT courses with placement support. Get your dream job in just 3 months
    we are giving online IT and non IT courses with placement support. Get your dream job in just 3 months. Our trainners having 11 years of experience in both IT and non IT courses. we have digital marketing experts also who has above 10 years of experience in digital marketing feild.
    training and placement courses in bangalore
    Courses

    Machine Learning



    Digital Marketing



    AWS



    Python



    Data Science



    Medical Coding



    Cyber Security



    MuleSoft



    Java-Testing



    Dotnet & SQL



    Cloud computing



    Salesforce

    ReplyDelete
  47. Thanks For sharing this wonderful blog.
    if you want to learn Angular Course in Pune once's visit- IT education Centre pune

    ReplyDelete
  48. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...Best Software Development Company in Mohali

    ReplyDelete
  49. Informative blog . thanks for sharing,
    ccna classes in pune

    ReplyDelete
  50. Wondering about the duration of fumigation? Get a comprehensive guide on the duration of fumigation and understand the factors that influence the timeline of this pest control procedure.
    Understand the process and benefits of fumigation services. Explore what fumigation service entails and how it can effectively eliminate pests while providing long-lasting results for your home or business.
    Comparing fumigation and fogging? Discover which method is better suited for your pest control needs. Learn about the differences and considerations for choosing the appropriate approach.
    Dive into the distinctions between pest control and fumigation. Explore the differences between pest control and fumigation and gain insights into when each method is most effective in addressing pest infestations.
    Curious about how a pest control system works? Discover how a pest control system effectively targets and eliminates pests, providing you with a pest-free environment and peace of mind.

    ReplyDelete
  51. "Computer Programming and Technology For Dummies" is an excellent resource for individuals looking to dive into the world of computer programming and technology. This book, Best cinema cameras, part of the renowned "For Dummies" series, offers a beginner-friendly approach to understanding the fundamentals of programming and the latest advancements in technology.

    Whether you are a complete novice or have some basic knowledge, this book provides clear explanations and practical examples that make complex programming concepts accessible to everyone. It covers a wide range of topics, including programming languages, algorithms, data structures, web development, mobile app development, cybersecurity, and artificial intelligence.

    One of the key strengths of "Computer Programming and Technology For Dummies" is its ability to break down complex concepts into easily understandable chunks. The authors use a conversational tone, avoiding technical jargon, and providing relatable analogies to ensure readers can grasp the material effortlessly. The book's step-by-step approach allows beginners to gradually build their programming skills and progress at their own pace.

    Additionally, "Computer Programming and Technology For Dummies" keeps up with the latest trends and technologies. It introduces readers to popular programming languages like Python, Java, and JavaScript, while also exploring emerging fields such as machine learning, cheap camera for photography, blockchain, and the Internet of Things (IoT). This comprehensive coverage equips readers with the knowledge needed to navigate the rapidly evolving landscape of computer programming and technology.

    ReplyDelete
  52. Thank you for sharing this blog.visit:Aws Course Online

    ReplyDelete
  53. thank you for your information I am glad you found the information in this blog interesting and informative Future Scope of Data Analytics

    ReplyDelete
  54. Recently I saw your blog, thanks for the information. Internet Marketing

    ReplyDelete
  55. Thank you for this helpful post. It's really informative Blog. Visit here: CuZn 36 Rohr

    ReplyDelete
  56. Thanks admin for sharing this I like this.If you want to know about Java so you can visit: Java Performance Tuning: Optimizing Your Code for Speed

    ReplyDelete
  57. HACK ATM AND BECOME TODAY RICH You can hack and crash into it without having too much weapons경상뢁도 or weapons. How is that possible?

    ReplyDelete
  58. Thank you for your kind words! I'm delighted to hear that you found the content enjoyable and valuable. Your encouragement is greatly appreciated. If you have any more topics or questions you'd like information on, feel free to let me know.
    visit: Full Stack Development Frameworks Comparison

    ReplyDelete
  59. Excellent information, many thanks for providing this kind of data. The most fascinating and best information is provided on your website. Regards!
    Power Bi Training in Hyderabad

    ReplyDelete
  60. Thank you for sharing. I always appreciate engaging content with valuable insights. The presented ideas are exceptional and innovative, making the post truly enjoyable. Keep up the fantastic work.

    Visit site: Data Magic: Python's Role In The Age Of Analytics

    ReplyDelete
  61. I'm impressed by the depth of information provided. Here to start AWS  learning journey.

    ReplyDelete
  62. Top SEO Companies in Noida
    we help you deliver the right information to engage people. We will carefully analyze your business strategy and implement all the methods and techniques to give you an ideal solution. Our SEO strategy includes high-end tools, technical expertise, and dedication to helping businesses grow.

    It is increasing the visibility of a website or webpage on SERP. Therefore, being on the first page will make the website easier to find. SEO involves many factors like design, marketing, content production, etc. WeApplications is the best SEO agency in Noida that provides the best SEO services for your business.

    ReplyDelete
  63. This comment has been removed by the author.

    ReplyDelete
  64. It’s rare to find an article that explains things so thoroughly yet so simply. The writer did a fantastic job making this topic accessible to everyone. Well done! Visit our link for ISO Certification in Saudi Arabia


    ReplyDelete
  65. Trust Legend Physiotherapy to provide exceptional ankle sprains physiotherapy treatments, helping you recover with professional care and attention
    Ankle Sprains Physiotherapy in Abbotsford

    ReplyDelete