Explain static and dynamic memory allocation with an example each.
No Answer is Posted For this Question
Be the First to Post Answer
In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest.
How are the features of c++ different from c?
How much is size of struct having 1 char & 1 integer?
What is the best book for c++ beginners?
Out of fgets() and gets() which function is safe to use and why?
how many trys can we write in one class
How do you declare a set in c++?
When do we run a shell in the unix system? How will you tell which shell you are running?
Why use of template is better than a base class?
What is the use of namespace std in C++?
Describe linkages and types of linkages?
A prime number is a number which is divisible only by itself and 1. Examples of the first few primes are 2, 3, 5, 7, 11. Consider writing a program which can generate prime numbers for you. Your program should read in and set a maximum prime to generate and a minimum number to start with when looking for primes. This program should be able to perform the following tasks: 1. Read the maximum number from user (keyboard input) to look for primes. The program should not return any primes greater than this number. 2. Read the minimum number from user (keyboard input) to look for primes. The program should not return any primes less than this number. 3. Generate and print out every prime number between the maximum prime and minimum number specified by the user.