Difference between Class and Struct.
Answers were Sorted based on User's Feedback
Answer / ravish
Structure is a value type variable, but a class is a
reference type variable.
We can create an object of a class but not for a structure.
Structures does not have function definition but a class has..
Is This Answer Correct ? | 6 Yes | 7 No |
Answer / farhat khan
In C struct does not use function(method).
Is This Answer Correct ? | 6 Yes | 10 No |
Answer / naksh @tcs
The major difference between struct and class is :
Struct donot contain functions(methods) as its members.
Yes, by default members of struct are public and that of a
class are private.
Is This Answer Correct ? | 33 Yes | 79 No |
write a C code to reverse a string using a recursive function, without swapping or using an extra memory.
9 Answers Motorola, TCS, Wipro,
how to set Nth bit of a variable?
difference between i++* and *++i
How to write a multi-statement macro?
Difference between exit() and _exit() function?
int arr[] = {1,2,3,4} int *ptr=arr; *(arr+3) = *++ptr + *ptr++; Final contents of arr[]
What is the use of putchar function?
what is array?
What is a pointer on a pointer in c programming language?
Why do we use header files in c?
#include<stdio.h> int f(int,int); int main() { printf("%d",f(20,1)); return 0; } int f(int n,int k) { if(n==0) return 0; else if(n%2)return f(n/2,2*k)+k; else return f(n/2,2*k)-k; } how this program is working and generating output as 9....?
totally how much header files r in c language