C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 9.6, Problem 3E
(For thought) a. What’s an advantage of namespaces?
b. What’s a possible disadvantage of namespaces?
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
(c) Does an integer pointer store an integer itself or something else?
(d) What is the purpose of pointers? What do they allow us to do? What would happen if we
didn't have pointers?
The issues:Memory leaks, bad pointers, and writing to the end of the memory allotted.When it comes to memory management, C++ offers a tonne of freedom. You can directly work with pointers and allocate and deallocate memory. Flexibility entails a price. You can make mistakes with allocations because the language lets you do so. The usage of pointers and deallocation are both subject to error. What can you do to secure your code because C++ lacks built-in safety checks?
The Issues: Bad pointers, writing to the end of allotted memory, and memory leaks are all possibilities.When it comes to memory management, C++ provides a great deal of freedom. You can allocate and deallocate memory as well as directly manage pointers. Flexibility comes at a price. Because the language permits you to allocate memory, you can make mistakes. Similarly, you may mess up deallocation and pointer usage. What do you do to secure your code in C++ when there are no built-in safety checks?
Chapter 9 Solutions
C++ for Engineers and Scientists
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- The Problems: Bad pointers, writing of the end of allocated memory, memory leaks.C++ gives you lots of flexibility when it comes to memory management. You are allowed to allocate and deallocate memory and directly manipulate pointers.Flexibility comes with a cost. Because the language allows you to allocate memory, you can screw up the allocations. Similarly you can screw up the deallocation and use of pointers. Since there are no built-in safety checks in C++ what do you do to protect your code?arrow_forward9) In Java, reserved terms may be redefined by the compiler to mean anything other than what they were intended to mean. (Is it a T or a F)?arrow_forward“Dangling and wild pointers are known to be problems with pointers”. Justify the given statement with the help of suitable examples. -C languagearrow_forward
- The Issues: Bad pointers, writing to the end of allotted memory, and memory leaks are all possibilities.When it comes to memory management, C++ provides a great deal of freedom. You can allocate and deallocate memory as well as directly manage pointers. Flexibility comes at a price. Because the language permits you to allocate memory, you can make mistakes. Similarly, you may mess up deallocation and pointer usage. What do you do to secure your code in C++ when there are no built-in safety checks?The Issues: Bad pointers, writing to the end of allotted memory, and memory leaks are all possibilities.When it comes to memory management, C++ provides a great deal of freedom. You can allocate and deallocate memory as well as directly manage pointers. Flexibility comes at a price. Because the language permits you to allocate memory, you can make mistakes. Similarly, you may mess up deallocation and pointer usage. What do you do to secure your code in C++ when there are no built-in safety…arrow_forward2. This question is about code generation. (a) What data structure is used as input to code generators? What feature of it makes the implementation of code generators simple and efficient?arrow_forwardExplain preprocessor directives in C. Describe Error and pragma directives and write code snippets. Describe define, and undef, directives.arrow_forward
- 3. What are the possible operations that can be performed on pointers. Explain with help of suitable example. -IN C LANGUAGEarrow_forward26. A) Define pointer in C language. How the declarations are made for pointer variables? What is the difference between the function pointer and pointer to a function?arrow_forward4. Assume the languages C++ and Java. Give as precise binding times as you can for the following attributes (Language definition, language implementation, translation, execution, etc.): (5 points) The presence of constants. The body of a function. The bit size of a long. The memory location of a dynamically allocated variable. The value of a constant The location of a functionarrow_forward
- Answer the following questions with regard to C++ pointers and Java reference variables. Keep in mind the safety and convenience as the primary considerations. a) Name two problems with C++ pointers. Use example (code) to illustrate each problem. b) Will problems similar to that identified in (a) occur in Java? Why or why not? (c) What was lost and what was gained in Java’s designers’ decision to not include the pointers of C++. (State briefly.)arrow_forwardplease help, make the diagram very clear and make sure to use c++ terminology please. if possiible could you make the diagram handwritten :) Fish have different species, sizes, colours and favourite foods. They can swim, `blub`, and attempt to eat food (which can be successful or not—depending on what it is). Fish live in aquariums that are of particular volumes and shapes. Aquariums have different kinds of lights, gravel, and filtration technology. Fish can also fight with one another… it is all very exciting. Create class diagrams for the candidate entities in the above paragraph. You can do the UML ascii art style or submit physically.arrow_forwarda) Discuss the different debugging functions and capabilities?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Computer Fundamentals - Basics for Beginners; Author: Geek's Lesson;https://www.youtube.com/watch?v=eEo_aacpwCw;License: Standard YouTube License, CC-BY