Answer Posted / chandra
to achieve synchronization with the normal languages like c.
for example int a=10,b=30,c;
c = a+b ;
the above operation is possible in c as well as c++.bcos
the variables declared are primitive types.
If u want to do same thing for user defined datatypes, i
can say objects, we have to overload the operators.
For ex:
Assume that u created one class
Class A
and u have created objects
A obj1(10),obj2(30),obj3;
and u want the add 2 objects and result must be stored in
another object.
then u have to overload the operator + for class A.
obj3 = obj1 + obj2 ;
Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What is encapsulation c#?
What is inheritance write a program to show use of inheritance?
How many human genes are polymorphic?
Can destructor be overloaded?
Whats oop mean?
What does enum stand for?
This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.
write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.
What is abstraction oop?
What are the benefits of interface?
What language is oop?
What is the benefit of oop?
#include
Which is better struts or spring?
What is the real time example of encapsulation?