1,054 views
1 1 vote
Which of the following is the proper keyword or function to allocate memory in C?
A. new
B. malloc
C. create
D. value

1 Answer

0 0 votes
malloc is used for the dynamic allocation of memory in C.

new is used for allocating the memory in C++.
Position:
Show:

Related questions

8 8 votes
1 1 answer
269
269 views
GO Classes asked Jun 19
269 views
What is the output of the following code?#include <stdio.h void fun(int a[], int *p) { a = a + 5; *(p + 2) = *(p + 2) + 10; p++; *p = *p + 1; } int main() { int arr[] =...
6 6 votes
1 1 answer
218
218 views
GO Classes asked Jun 19
218 views
What is the output of the following code?#include <stdio.h int main() { int arr[] = {10, 20, 30}; int *p = arr; printf("%d %d", *p, *(arr + 2)); return 0; }$\texttt{10 20...
8 8 votes
1 1 answer
226
226 views
GO Classes asked Jun 6
226 views
What is the output of the following code?#include <stdio.h void change(int *p, int *q) { *p = *p + 4; *q = *p + *q; p = q; *p = *p - 3; } int main() { int a = 6, b = 10; ...
8 8 votes
1 1 answer
233
233 views
GO Classes asked Jun 6
233 views
What is the output of the following code?#include <stdio.h int main() { int a = 8, b = 12; int *p = &a; int *q = &b; *p = *p + *q; q = p; *q = *q - 5; printf("%d %d", a, ...