difference between static and non-static variables?
Answers were Sorted based on User's Feedback
Answer / santosh mundhe
Static:1)Memory allocated before creation of object.
2)Gets memory on Global segment.
3)Object can't get copy of static variable, each
object shears static variable from global segment.
4)Static variables are not part ob object.
Non-static:
1)Gets memory on satck segment.
2)Object gets copy of non static variable.
3)Non static variables are part of object.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / sujitha.r
Static:
*No instance is required.
*Automatic Invocation.
Non-Static:
*Instance is required.
| Is This Answer Correct ? | 0 Yes | 0 No |
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.
What is overriding vs overloading?
Why do we use virtual functions?
What is ambiguity in inheritance?
What are constructors in oop?
why reinterpret cast is considered dangerous?
How can i write a code in c# to take a number from the user and then find all the prime numbers till the number entered by the user.
What is purpose of inheritance?
How Do you Code Composition and Aggregation in C++ ?
What is multidimensional array?
What are the 3 principles of oop?
how to find the correct email address format by using the programe?