answersLogoWhite

0

The new and delete operators in C++ are not related to flush. New is used to allocate memory, while delete is used to deallocate memory. Flush is a library concept that allows you to ensure that IO is completed, and not buffered, before proceeding to the next step.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What are new and delete operators in c plus plus?

New and Delete are the memory management operators in c++,like c language we use malloc() and calloc() functions to allocate memory and free() functiong to release the memory similarily we use new to allocate memory in C++ and Delete to release the allocated memory....


Printf and scanf Operators in C and C plus plus?

No, they are functions. Operators are -> or ++or /=


Difference between new and delete in c plus plus?

New creates objects. Delete deletes objects. eg - int *x = new int; // Give me a new int eg - delete x; // Delete the int that was created These functions are useful because they allow you to allocate as much memory as you need (eg ask the user for how many numbers do they want to type in, allocate that many ints and then loop through and store the values). Note that there are two other operators, new[] and delete[] that are used for creating/deleting arrays. eg - int *x = new int[5]; // Give me 5 new ints eg - delete[] x; // Delete the 5 ints If you mix and match the different operators(eg new[] with delete) you may end up with memory leaks - delete only expects one object, so if you give it 10 objects created by new[] then it will only delete one.


C plus plus bit-wise operators?

Are very useful. Examples: & | ^ ~


What is used to test value of character or integer in c plus plus?

Use the comparison operators (==, <, <=, >, >=). All primitives (including char and int) support these built-in operators.


Memory allocation in c plus plus?

Although C++ inherits malloc/calloc, realloc and free from C, programmers are encouraged to use the object-oriented operators, new and delete instead. Not only are they much easier to use, they can also be used with primitive data types.


Four new operators added by c plus plus that aids OOP?

The new operators in C++ (but not in C) are new, delete, compl, and, and_eq, not, not_eq, or, or_eq, xor, xor_eq, bitand and bitor. Of those only the first two can really be said to aid OOP. However, other keywords that specifically aid OOP include class, friend, mutable, private, protected, public and template.


What operators perform mathematical calculations such as adding and subtracting?

The main four operators are: Plus (+) Minus (-) Multiply (*) or (x) Divide (/) or (÷)


What are the storage allocation in C plus plus?

They mostly deal with pointers and new operators in memory.


What is the definition of Punctuators and Operators in C plus plus?

The following are the C++ punctuators: ! % ^ & * () - + = {} | ~ [] \ ; ' : " < > ? , . / # Some punctuators are also operators. The exact meaning of a punctuator is dependant upon the context. For instance, the open/close brace {} is used as a punctuator to delimit a class declaration, a function definition or a compound statement. But as an operator, it used to delimit an initialisation list. The # punctuator only has meaning to the preprocessor, used to introduce a preprocessing directive. Some punctuators can also be combined to produce other operators, such as: :: .* -> ->* && ++ -- == != <= >= += -= *= /= %= ^= |= &= << <<= >> >>= ?: ... In addition, C++ also has the following punctuators as operators: new delete and and_eq bitand bitor comp not not_eq or or_eq xor xor_eq


Which operator is used for deallocating memory in c plus plus?

delete


What command is used to destroy object in c plus plus?

You use delete object in C++ to delete an object. You can also implicitly delete the object, if it is automatic type, by going out of local scope.