Does this mean that when we allocate memory through malloc, the garbage value will stored at that memory location. When we allocate memory through calloc, every variable will initialized to 0.
Type: Posts; User: muke786
Does this mean that when we allocate memory through malloc, the garbage value will stored at that memory location. When we allocate memory through calloc, every variable will initialized to 0.
exactly I do not understand what it means "initialize it to zero"
If we want to store value of five integer we need 20 bytes so malloc function will allocate 20 bytes to store five integer value...
Hi guys,
I tried to understand calloc function in c language I have gone through the many pages but I do not understand fundamental What is Calloc in C?
#include<stdio.h>#include<stdlib.h>...
What I think is
P = NULL; memory is not allocated so size should be 0
P = malloc (1 * sizeof(int)); memory allocated so size should be 4
P = free(P); memory has been released so the size should...
Why the size of P is 4 after Release memory?
P = 10
P = 4 ...
#include <stdio.h> void addition (int a, int b)
{
int c = a + b;
printf ("c = %d \n", c);
}
int main ()
{
Result is not as expected, line free(P); give output Segmentation fault (core dumped) what's the wrong with it
#include <stdio.h>#include <stdlib.h>
int main ()
{
int *P = NULL;
...
But I am passing two actual argument in main function
gone through following links
Too few arguments to function (C language Error)
oh Thank you What's wrong with code
#include <stdio.h>
void addition (int a, int b)
{
int c = a + b;
printf ("c = %d /n", c);
}
Function pointer is use to call function by it's address Why program doesn't print statement ?
#include <stdio.h>
void colour ()
{
printf("Green colours");
}
It say when static use inside in function it is only visible only to the function in which it is defined. and when static use outside the function it say variable will visible to all the functions in...
Hello Everybody
I found the description for the keyword static here Static Variables in C - GeeksforGeeks which I do not understand for static global variable
Any help would be appreciated
I am not clear I do not understand when to use double data type ?
I am beginner in c programming, As far as I understand it is used to store decimal number and float number.
#include <stdio.h> int main()
{
int a = 1;
char b ='G';
double c...