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 the Difference between Class and Struct?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the Difference between Class and Struct?
Answer
# 1
by default 
struct elements are public
while
class elements are private
 
Is This Answer Correct ?    4 Yes 0 No
Ashish Srivastava
 
  Re: What is the Difference between Class and Struct?
Answer
# 2
Class elements are accessed using the provided methods.
 
Is This Answer Correct ?    2 Yes 0 No
Wfwre
 
 
 
  Re: What is the Difference between Class and Struct?
Answer
# 3
no functions in structures
member functions are available in class
 
Is This Answer Correct ?    3 Yes 2 No
Revathy
 
  Re: What is the Difference between Class and Struct?
Answer
# 4
The only difference between class and struct is that

in class all members are private by default whereas in 

struct the members are by default public.
 
Is This Answer Correct ?    5 Yes 0 No
Manju
 
  Re: What is the Difference between Class and Struct?
Answer
# 5
1.the variables of struct r jus varialbles inly,whereas it 
it objects for class...

2. pointers can be used in structure only for same return 
types,but in classes it can be uses for diff classes
 
Is This Answer Correct ?    1 Yes 0 No
Vishnupriya
 
  Re: What is the Difference between Class and Struct?
Answer
# 6
answer 3 is wrong.
answer 4 is absolutely corret.
 
Is This Answer Correct ?    1 Yes 0 No
Purna
 
  Re: What is the Difference between Class and Struct?
Answer
# 7
the diff b/w structure and class is class by deafualt 
private, where as structure by default public.
 
Is This Answer Correct ?    1 Yes 1 No
Sureshreddy
 
  Re: What is the Difference between Class and Struct?
Answer
# 8
STRUCTURE                         CLASS
1.structure by default is     1. class by default is private
public. 
2.structure does not          2.class provide data hiding.
provide data hiding. 
3.A structure would be the    3.class would be the collection
collection of related data.     of data & code which handels
                                      data.


CAN U TELL ME MORE DIFFERENCE BETWEEN LIKE THIS PLZ TELL ME
AS EARLY AS POSSIBLE I AM WAITING
 
Is This Answer Correct ?    1 Yes 0 No
Satvir Kaur
 
  Re: What is the Difference between Class and Struct?
Answer
# 9
Structs allocates continues memory
where as class does not
structs and functions are the basic idea behind class
 
Is This Answer Correct ?    0 Yes 0 No
Santhosh.r
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what is the difference between c and java?  1
#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } Find the output CitiGroup4
C program to perform stack operation using singly linked list  1
how many argument we can pas in in a function CTS20
what is the defrenece between structure and union  5
how to find out the biggest element (or any other operation) in an array which is dynamic. User need not to mention the array size while executing.  2
can we print any string in c language without using semicolon(;)(terminator) in whole program.  6
User define function contain thier own address or not.  2
What is volatile in c language? HCL1
Consider a language that does not have arrays but does have stacks as a data type.and PUSH POP..are all defined .Show how a one dimensional array can be implemented by using two stacks. Google3
main() { printf(5+"good morning"); printf("%c","abcdefgh"[4]); }the o/p is morning and e...how someone explain  1
HOW TO ANSWER IF ASKED " WHAT KIND OF A PERSON ARE YOU?" I NEED AN ANSWER THAT IMPRESS THE INTERVIEWER  2
What kind of sorting is this? SORT (k,n) 1.[Loop on I Index] repeat thru step2 for i=1,2,........n-1 2.[For each pass,get small value] min=i; repeat for j=i+1 to N do { if K[j]<k[min] min=j; } temp=K[i];K[i]=K[min];K[min]=temp; 3.[Sorted Values will be returned] A)Bubble Sort B)Quick Sort C)Selection Sort D)Merge Sort Accenture3
difference between function & structure Verizon5
What does extern mean in a function declaration?  2
6. Which of the Following is not defined in string.h? A)strspn() B)strerror() C)memchr() D)strod() Accenture1
any string of bits of length 'n' represents a unique non- negative integer between.............?  2
f(char *p) { p=(char *)malloc(sizeof(6)); strcpy(p,"HELLO"); } main() { char *p="BYE"; f(p) printf("%s",p); } what is the output? Hughes6
Study the Following Points: a.One Cannot Take the address of a Bit Field b.bit fields cannot be arrayed c.Bit-Fields are machine Dependant d.Bit-fields cannot be declared as static 1. Which of the Following Statements are true w.r.t Bit- Fields A)a,b&c B)Only a & b C)Only c D)All Accenture2
write a program structure to find average of given number  1
 
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