You have two pairs: new() and delete() and another pair : alloc() and free().  Explain differences between eg. new() and malloc()

1 Answer

Answer :

1.) “new and delete” are preprocessors while “malloc() and free()” are functions. [we dont  use brackets will calling new or delete].  
2.) no need of allocate the memory while using “new” but in “malloc()” we have to use  “sizeof()”.  
3.) “new” will initlize the new memory to 0 but “malloc()” gives random value in the new  alloted memory location [better to use calloc()]  
Answer2
new() allocates continous space for the object instace
malloc() allocates distributed space.
new() is castless, meaning that allocates memory for this specific type, malloc(), calloc() allocate space for void * that is cated to the specific class type pointer.

Related questions

Description : malloc() Function- What is the difference between "calloc(...)" and "malloc(...)"?

Last Answer : 1. calloc(...) allocates a block of memory for an array of elements of a certain size. By default the block is initialized to 0. The total number of memory allocated will be (number_of_elements * ... calls malloc(...) in order to use the C+ + _set_new_mode function to set the new handler mode.

Description : One more ebay search question. Is there a way to ask one term or another? eg: new or NIB?

Last Answer : answer:Use parentheses for OR searches. To search for one word OR another, put the words in parentheses, divided by commas. In your example, you can look for listings that contain either of the words by surrounding the words in parentheses: (new, NIB) and BTW, capitalization doesn’t really matter.

Description : Four members of a band are walking to a night concert. They decide to take a shortcut, but must cross a bridge. Luckily they have one flashlight. Because of the varying size of their instruments, it ... bridge and still get to the concert on time. What order should they cross to get eve -Riddles

Last Answer : First, the one minute person and the two minute person must cross the bridge, for a total of two minutes. Then the one minute person should come back with flashlight - total of three ... minutes) and gets the one minute person and they cross together bringing the total to seventeen minutes.

Description : What is the differences between the delete key and the backspace key?

Last Answer : No difference at all

Description : Give two eg of contact force ? -Physics

Last Answer : The eg of contact forces are: Frictional force and Muscular Force .

Description : What is the part of the backpack (for eg.) that's held to shorten or lengthen it? See detail for image.

Last Answer : I would call those adjustabelts.

Description : Is it obvious or not obvious why some stores charge customers (annual for eg.) a fee in order to sell them their products?

Last Answer : I worked in a grocery store that was a Franchise and that company charges a fee to have the ideal placement on the shelves, or near the cash register , knowing that some people (or most) buy on impulse. That is why adverting of a product with colorful and eye catching themes becomes very important .

Description : Why do some newspaper columnists (for eg.,) require you to have a facebook account?

Last Answer : HUH? I don’t understand the Q.

Description : Is it true that long-term use of Oxycodone creates pain by destroying your body (eg. ruining joints)

Last Answer : answer:Actually, its a vicious circle of pain and the threat of more pain. People who have migraine headaches are some of the most prone people to become addicts of pain medicene. I do not ... relief. I was a lifetime sufferer of migraine headaches. Its easy to become addicted to pain pills.

Description : Why do some tolerate people who make fun of victims of tragedy? Japan Tsunami for eg.?

Last Answer : So they called attention to what happens when people do inappropriate things. Those people get fired and have to find a way to get past it and find something else to do which isn't so ... . Talking about his latest controversy and the consequences of his behavior with him is not rewarding him.

Description : Ebay search question. Is it possible to search on ebay for all "except" certain items? eg: unlocked cell phones "except motorola"?

Last Answer : I don’t think so. I would think that that would make motorola phones come up even more seeing as it searches mostly for the key words of the search.

Description : Are there any websites that ship to Canada that have really nice woman summer clothes? Eg. Dresses, shirts, etc.

Last Answer : Did you try EbAY>

Description : I need advice on which clutter to keep and what can be thrown away - eg photos, tickets, certificates etc?

Last Answer : I hate clutter, but every time I throw something out I wind up years later wishing I hadn’t. Even old clothes. It’s maddening.

Description : Why are child genuis only revealed to the world once they are older? Why are their earlier extraodinary developments never really recorded eg child started talking age 4months etc?

Last Answer : I wouldnt say a child COULDN'T talk at 6 months old, but it's unlikely (in my opinion) that any 6 month old would be able to tell the doc they had an inner infection. Would the even know ... maybe there are kids out there who have the intelligence and woids to do just about anything. I hope so. BB

Description : If someone comes to the door and you dont feel like seeing anyone - eg bad hair day or in your pjs or house a mess what do you find yourself doing?...

Last Answer : i don’t open it if i don’t feel like it. no need to hide!

Description : Rewiring digital clocks to make them run faast? (eg- make 24 hours go by in 24 minutes)

Last Answer : Not really. The levels of integration are too high to allow any user modification.

Description : Which indefinite article should i use before "one", eg, "a one dimensional line" or "an one dimensional line"?

Last Answer : a

Description : A plant similar to my Dianthus but with different colors, eg. Yellow, white

Last Answer : Need Answer

Last Answer : EG - Exempli Gratia

Description : Carbon skeleton produced during respiration. (Eg. `alpha`-ketoglutarate, OAA etc. intermediates) are used as precursor for biosynthesis of other molec

Last Answer : Carbon skeleton produced during respiration. (Eg. `alpha`-ketoglutarate, OAA etc. intermediates) are ... biosynthesis of other molecules in the cell.

Description : Carbon skeleton produced during respiration. (Eg. `alpha`-ketoglutarate, OAA etc. intermediates) are used as precursor for biosynthesis of other molec

Last Answer : Carbon skeleton produced during respiration. (Eg. `alpha`-ketoglutarate, OAA etc. intermediates) are ... biosynthesis of other molecules in the cell.

Description : Exoskeleton originated from (Eg feathers, nail horn, hoofs) : -

Last Answer : Exoskeleton originated from (Eg feathers, nail horn, hoofs) : - A. Connective tissue proper B. Epithelium tissue C. Skaletal tissue D. Vascular tissue

Description : Mean applied when deals with relative changes eg. Bacterial growth, cell division, population

Last Answer : Ans. GM

Description : In the illustration, the diode between terminals 16 and 17 is to _________. EL-0046 A. insure that the voltage across the governor coil (EG-3P) never exceeds .6 VDC B. compensate for the ... heating up C. protect the electronic governor from counter EMF D. act as a filter to prevent hunting

Last Answer : Answer: C

Description : Remittances from a branch office to its account office are either sent by post or through carrier eg. a) Postmen b) Village postmen c) Overseer’s. d) Any one of them

Last Answer : d) Any one of them

Description : A fundamental equation of void ratio (e), specific gravity (G), water content and degree of saturation (Sr ) is (A) e = /Sr (B) = eG/Sr (C) G = /S (D) Sr = /G

Last Answer : (A) e = /Sr

Description : What is Environment Class (EC) and Environment Generator (EG)?

Last Answer : EC – It is defined as a group of environment. EG – It selects the environment from environment class in which the agent has to Run. 

Description : There were two pairs hanging on a tree, one man walked by and took a pair. Soon after a second man also took a pear from the tree. However, even after both men took fruit from the tree there was still a pear left on the tree. How could this be? -Riddles

Last Answer : There were four pears (2 pairs) on the tree. The first man took a pair (2 pears) and the second only took one pear leaving one pear on the tree.

Description : A cockroach has (a) Three pairs of walking legs (b) Two pairs of walking legs (c) Four pairs of walking legs (d) One pair of walking legs

Last Answer : Ans:(a)

Description : The skin biting mosquito has legs as locomotory organ which are – (1) Four pairs (2) Three pairs (3) Two pairs (4) One pair

Last Answer : (2) Three pairs Explanation: Like all other insects, in a mosquito, the thorax is specialized for locomotion. Three pairs of legs and a pair of wings are attached to the thorax. The insect wing is an outgrowth of the exoskeleton.

Description : Which of the following statements is correct? (a) Adenine pairs with thymine through two H-bonds. (b) Adenine pairs with thymine through one H-bond. (c) Adenine pairs with thymine through three H-bonds. (d) Adenine does not pair with thymine

Last Answer : ) Adenine pairs with thymine through two H-bonds.

Description : Echo suppressor is detrimental to full duplex operation because (A) It disables one of the two pairs in a four-wire trunk line when a signal is detected on the other pair. (B) It enables one of the ... It activates both the pairs of a four-wire trunk line. (D) It is independent of line conditions.

Last Answer : (A) It disables one of the two pairs in a four-wire trunk line when a signal is detected on the other pair.

Description : The skin biting mosquito has legs as locomotory organ which are (1) Four pairs (2) Three pairs (3) Two pairs (4) One pair

Last Answer : Three pairs

Description : A task is done by 46 persons not all of them have the same capacity to task. Every day exactly 2 persons, do the task with no pair of persons working together twice. Even after all possible pairs have worked ... in which all the persons together will finish the whole task? a) 44 b) 45 c) 46 d) 47

Last Answer : D 46 persons task in pairs, with no same pair of persons working together. Each person will be working with other 45 which means each persons will work for 45 days in pair. Let the time taken by each ... +1/T46)= 1/47 If all the persons work together they will finish the whole task in 47 days.

Description : Did you catch the Olympics Pairs Figure Skating yesterday ? The judges gave the gold to the pair who made a deduct a point kind of mistake and the the silver to the flawless pair. Has anything started in the way of contest?

Last Answer : Well I figured they (the judges) know better and maybe because the gold medalists were skating forever (over 18 years) and this was their last chance and then they were going to go off and make babies after and also because Canada is afraid of China (okay the last two reasons are false)

Description : 1. Draw different pairs of circles. How many points does each pair have in common? What is the maximum number of common points? -Maths 9th

Last Answer : As we can see from the figure, that two circles have two points in common. Two circles cannot intersect each other at more than two points. Let us assume that two circles cut each other at ... circle can pass. So, two circles if intersect each other will intersect at maximum two points.

Description : what-Helena was asked to prove that any pair of vertical angles is congruent. She was provided a diagram with several pairs of vertical angles.?

Last Answer : Helena noticed that vertical angles are always supplementary to a common angle. She wrote, “Vertical angles share a common supplementary angle, so by the Congruent Complements Theorem, they are congruent.Why is Helena’s proof incorrect?

Description : Three of the following pairs of the human skeletal parts are correctly matched with their respective inclusive skeletal category and one pair is not m

Last Answer : Three of the following pairs of the human skeletal parts are correctly matched with their respective ... not matched. Identify the non-matching pair

Description : Three of the following pairs of the human skeletal parts are correctly matched with their respective inclusive skeletal category and one pair is not m

Last Answer : Three of the following pairs of the human skeletal parts are correctly matched with their respective inclusive skeletal ... " , ," Ear ossicles "):}`

Description : Can you stop checking for factor pairs when you find a pair that repeats?

Last Answer : Need answer

Description : Select one attribute that describes the quadrilateral. A. Only one pair of opposite sides are parallel. B. There are no right angles. C. Both pairs of opposite sides are congruent and parallel. D. All sides are an equal length?

Last Answer : Please answer ASAP

Description : Consider the following pairs: Tree: Location of its natural habitat 1. Rosewood: Slopes of Western Ghats of Karnataka and Kerala 2. Spruce : Western Himalayas at elevations from 2100 m to 3600 'm 3. Walnut: Lower elevations on Eastern ... IAS 2009] (a) A only (b) A and B (c) Band C (d) A, B and C

Last Answer : Ans: (b)

Description : An insect is an organism having - (1) 3 pairs of legs (2) 4 pairs of legs (3) Head, thorax and abdomen (4) Pair of wings and antenna

Last Answer : (1) 3 pairs of legs Explanation: An insect is an organism having three pairs of legs. Insects are small, landdwelling arthropods, characterised by three pairs of jointed legs. It has three distinct ... (comprising the scape, pedicel and flagellum), compound eyes and often one or two pairs of wings.

Description : Which one of the following cannot be explained on the basis of Mendel's law of dominance? (a) The discrete unit controlling a particular character is called a factor. (b) Out of one pair of ... any blending and both the characters recover as such in F2 generation. (d) Factors occur in pairs.

Last Answer : (c) Alleles do not show any blending and both the characters recover as such in F2 generation

Description : In human body, which one of the following is anatomically correct? (a) Collar bones - 3 pairs (b) Salivary glands - 1 pair (c) Cranial nerves - 10 pairs (d) Floating ribs - 2 pairs

Last Answer : (d) Floating ribs - 2 pairs

Description : Three of the following pairs of the human skeletal parts are correctly matched with their respective inclusive skeletal category and one pair is not matched. Identify the non-matching pair. Pair ... girdle cavity (c) Humerus and ulna Appendicular skeleton (d) Malleus and stapes Ear ossicles

Last Answer : (b) Clavicle and glenoid Pelvic girdle cavity

Description : The sum of 2 numbers is 216, and their HCF is 27. How many such pairs of numbers exist? (A pair a unique set of 2 numbers, so (a, b) and (b, a) will be considered as 1 pair). a) 0 b) 1 c) 2 d) 3 e) 4

Last Answer : Let the numbers be a,b A = 27m, b = 27n where m, n are co-prime 27(m + n) = 216, or m+n = 8 M = 1, n = 7 and m = 3, n = 5 are the only 2 co – prime pairs possible. So we have 2 pairs: (27 , 189) and ( 81, 135) Answer: c)

Description : Which of the following species contains three bond pairs and one lone pair around the central atom? (1) PCl3 (2) H2O (3) BF3 (4) NH2

Last Answer : PCl3

Description : A vertex cover of an undirected graph G(V, E) is a subset V1 ⊆ V vertices such that (A) Each pair of vertices in V1 is connected by an edge (B) If (u, v) ∈ E then u ∈ V1 and v ∈ V1 (C) If (u, v) ∈ E then u ∈ V1 or v ∈ V1 (D) All pairs of vertices in V1 are not connected by an edge

Last Answer : (C) If (u, v) ∈ E then u ∈ V1 or v ∈ V1