Computer

Write a C program and define a function that takes the length of your name as an input parameter and then allocates memory dynamically to store your name.

#include<stdio.h> #includeint main(){int *n; n = (char*) malloc (20 * sizeof(char) );pritf(“Enter your name”);gets(n); pritf(“Your name is”);while(n!=’0′); printf(“%c”,n++); return 0;}

Write a C program and define a function that takes the length of your name as an input parameter and then allocates memory dynamically to store your name. Read More »

Scroll to Top