how do u initialize the constant variables
Answers were Sorted based on User's Feedback
Answer / keshav.gadde
class sam
{
const int x;
public:
sam(int i):x(i)
{
cout<<i<<endl;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
sam s(10);
return 0;
}
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / bibin joy
class A
{
const int mConstVal ;
A():mConstVal (10)
{
}
}
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / yughandhar
as for my knowledge,the constant variables are intialised by
keyword called DEFINE
Eg:
#define pie=3.14
Is This Answer Correct ? | 4 Yes | 7 No |
tel me oops defination in single line
Can enum be null?
what is the size of an empty class
Write a macro for swapping integers
#include <string.h> #include <stdio.h> #include <stdlib.h> #include <conio.h> void select(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); select(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void select(char *items, int count) { register int a, b, c; int exchange; char t; for(a = 0; a < count-1; ++a) { exchange = 0; c = a; t = items[ a ]; for(b = a + 1; b < count; ++b) { if(items[ b ] < t) { c = b; t = items[ b ]; exchange = 1; } } if(exchange) { items[ c ] = items[ a ]; items[ a ] = t; } } } design an algorithm for Selection Sort
What is this pointer in oop?
What is object in oop with example?
What is encapsulation?
What is methods in oop?
Which language is pure oop?
tell about copy constructor
What do you mean by pure virtual functions?