Home / MCQ Bank / Computer
Computer Introduction To Data Structures

Consider the following definition in c programming language. struct node { int data; struct node * next; } typedef struct node NODE; NODE *ptr; Which of the following c code is used to create new node?

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option A • ptr = (NODE*)malloc(sizeof(NODE))

Related Computer Questions

What does the kableExtra package in R provide? What error is generated on placing an address operator with a variable in the printf statement? What will be the output of the following C++ code? #include <iostream> #include <string> #include <cstdlib> using namespace std; int main(int argc, char const *argv[]) { int a = 5; int &q = a; cout<<&a<<endl; cout<<&q<<endl; return 0; } What will be the output of the following C++ code? #include <stdio.h> #include<iostream> using namespace std; int main() { int x = 5, y = 5, z; x = ++x; y = --y; z = x + ++x; cout << z; return 0; } Which of the following is a library for JavaScript?