ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
What is a class?
 Question Submitted By :: Abalonesoft
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is a class?
Answer
# 1
A class defines a data type, much like a struct would be in
C. In a computer science sense, a type consists of both a
set of states and a set of operations which transition
between those states. Thus int is a type because it has both
a set of states and it has operations like i + j or i++,
etc. In exactly the same way, a class provides a set of
(usually public) operations, and a set of (usually
non-public) data bits representing the abstract values that
instances of the type can have. 

You can imagine that int is a class that has member
functions called operator++, etc. (int isn't really a class,
but the basic analogy is this: a class is a type, much like
int is a type.) 

Note: a C programmer can think of a class as a C struct
whose members default to private. But if that's all you
think of a class, then you probably need to experience a
personal paradigm shift. 

 
Is This Answer Correct ?    0 Yes 0 No
Abalonesoft
[Abalonesoft Technologies]
 
  Re: What is a class?
Answer
# 2
class is a user defined entity which has some real world
existence,and it is a way to bind the data and its
associated functions of different datatypes
 
Is This Answer Correct ?    0 Yes 0 No
Pushpanjali Panda
 
 
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
#define swap1(a,b) a=a+b;b=a-b;a=a-b; main() { int x=5,y=10; swap1(x,y); printf("%d %d\n",x,y); swap2(x,y); printf("%d %d\n",x,y); } int swap2(int a,int b) { int temp; temp=a; b=a; a=temp; return; } what are the outputs? Ramco4
What is the most efficient way to count the number of bits which are set in a value?  3
consider the following structure: struct num nam{ int no; char name[25]; }; struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}}; ..... ..... printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1); What does the above statement print? a.8,9 b.9,9 c.8,8 d.8,unpredictable value TCS3
what is the output of below pgm? void main() { int i=0; if(i) printf("pass"); else printf("fail"); }  3
What is the real difference between arrays and pointers?  11
What's the difference between calloc() and malloc()?  3
what is the difference between normal variables and pointer variables.............. Satyam7
proc() { static i=10; printf("%d",i); } If this proc() is called second time, what is the output? Hughes5
for example user gives input as " 20 or 20.0 or rs 20.0 or 20.00 or rs20 and so .. on " and the output should be stored as " rs.20.00 " in a variable  2
Go through the following code sinippet char a[20]; a="Hello Orcale Test"; will this compile? Oracle3
two progs are given. one starts counting frm 0 to MAX and the other stars frm MAX to 0. which one executes fast. Verifone5
what will be the output: main(){char ch;int a=10;printf("%d",ch);} Wipro29
main() { char *ptr = "Ramco Systems"; (*ptr)++; printf("%s\n",ptr); ptr++; printf("%s\n",ptr); } Find the Outputs? CitiGroup7
how many times does the loop iterated ? for (i=0;i=10;i+=2) printf("Hi\n"); TCS7
How do I declare a pointer to an array?  5
main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output?? Ramco13
Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….  1
prototype of sine function. Cadence2
actually i have 2 years teaching experience as computer faculty but now i am a DBA but when i go for interview many peoples asked me why i left my teaching profession and why i want to come in this field kindly give me the proper answer of this queston  1
simple c program for 12345 convert 54321 with out using string  5
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com