what is available in C language but not in C++?
Answers were Sorted based on User's Feedback
Answer / mukhtar
In c u can create variable with name new and delete but not
in c++.
Is This Answer Correct ? | 40 Yes | 22 No |
Answer / chandrasekhar
c progrm donein top to bottom apparoch but c++bottom to top
apparoch
Is This Answer Correct ? | 18 Yes | 1 No |
Answer / preeti singh
C allows a void* pointer to be assigned to any pointer type
without a cast, whereas C++ does not.
void* ptr;
int *i = ptr;
int *j = malloc(sizeof(int) * 5);
this is valid in C but not in C++.
In C++ explicit cast needs to be applied as given below.
void* ptr;
int *i = (int *) ptr;
int *j = (int *) malloc(sizeof(int) * 5);
Is This Answer Correct ? | 13 Yes | 1 No |
Answer / hussain reddy
malloc calloc realloc and free in c but not in c++
Is This Answer Correct ? | 7 Yes | 4 No |
Answer / amit soni
c is a structured language but c++ is object orientd.
Is This Answer Correct ? | 4 Yes | 2 No |
Answer / fynny
c supports register level programing, but c++ doesnot and
hence C is used in developing the operating system.....BY FYNNY
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / jibin jose
type conversion in c : (Datatype)value
type conversion in c++ : int(Datatype)
Is This Answer Correct ? | 1 Yes | 2 No |
Answer / faheem
in c default return type is void but in c++ it is int.
Is This Answer Correct ? | 2 Yes | 7 No |
Answer / sara
pointers r available in c which is not available in c++
Is This Answer Correct ? | 8 Yes | 44 No |
18)struct base {int a,b; base(); int virtual function1(); } struct derv1:base{ int b,c,d; derv1() int virtual function1(); } struct derv2 : base {int a,e; } base::base() { a=2;b=3; } derv1::derv1(){ b=5; c=10;d=11;} base::function1() {return(100); } derv1::function1() { return(200); } main() base ba; derv1 d1,d2; printf("%d %d",d1.a,d1.b) o/p is a)a=2;b=3; b)a=3; b=2; c)a=5; b=10; d)none 19) for the above program answer the following q's main() base da; derv1 d1; derv2 d2; printf("%d %d %d",da.function1(),d1.function1(),d2.function1 ()); o/p is a)100,200,200; b)200,100,200; c)200,200,100; d)none 20)struct { int x; int y; }abc; you can not access x by the following 1)abc-->x; 2)abc[0]-->x; abc.x; (abc)-->x; a)1,2,3 b)2&3 c)1&2 d)1,3,4
I have an array of 100 elements. Each element contains some text. i want to: append a star character to the end of every fifth element remove every second character from every tenth element, and… add a line feed (ascii 10) after the 30th character of every array element whose length is greater than 30 characters.
What is 02d in c?
Which header file should you include if you are to develop a function which can accept variable number of arguments?
How can I implement opaque (abstract) data types in C? What's the difference between these two declarations? struct x1 { ... }; typedef struct { ... } x2;
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
A.C func() { pritnf(" in fuction %d",MACRO); } MAIN.c testfunc() { #define MACRO 10 printf("in test function %d", MACRO); } main() { printf("in main %d",MACRO); func(); testfunc(); getch(); }
What standard functions are available to manipulate strings?
int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above
What is a pointer in c plus plus?
what is a non volatile key word in c language?
What is data structure in c programming?