Difference between Malloc and Calloc function MALLOC CALLOC -Accept one argument only -Accept two argument -The allocated memory would be initialized With garbage value -The allocated memory would be initialized with 0. -Allocate single block of memory - Allocate multiple block of memory
@divyprakashpandey4458 Жыл бұрын
This session's notes - Calloc() fxn - Calloc stands for Contiguous Allocation - Built-in function in stdlib.h - Its Function→Used to dynamically allocate multiple blocks of memory & each block is of same size - General Syntax↓ - void* calloc(size_t no._of_blocks , size_t*size_of_each_block); - Malloc VS Calloc - In Calloc the blocks are initialized with 0 & in Malloc it is initialized with Garbage Value - In Malloc a Single block of memory is allotted, In Calloc for same memory smaller memory blocks are allotted [yes, it confuses me too
@naughty_nobitha8 ай бұрын
bane xtral dengav ga
@rabbit-g3lАй бұрын
I'm confused about the same thing too in the last point
@abdulrahimjalloh363 Жыл бұрын
Assignment Two: 1. callloc means "contiguous allocation" 1. malloc means "memory allocation" 2. calloc is generally used in array 2. malloc is generally used in structure 3. calloc takes two arguments 3 malloc takes one argument 4 calloc dynamically allocate multiple block of memory of the same size 4. malloc allocate single block of memory 5. by default calloc initialize with zero values 5. by default malloc initialize with garbage values
@devSackey Жыл бұрын
Diifrence betweeen malloc() and calloc() functions Malloc() 1. The allocated memory by default is initialised with garbage value 2. Allocate a singly large block of memory 3. The function has one parameter Calloc() 1. The allocated memory by default is initialised with 0 2. Allocate multiple block of memory 3. The function has two parameters
@learnwithme69372 жыл бұрын
mam.....you are so special.... thank you for being on KZbin for us.........😇😇😇
@abdulrahimjalloh363 Жыл бұрын
Assignment one: #include #include int main (void) { int n,i,j,*ptr1; float num,*ptr2; printf(" Enter number of blocks: "); scanf("%d",&n); ptr1=(int *)calloc(n,sizeof(int)); if(ptr1==NULL) { printf("Cannot allocate memory "); exit(1); } printf("Enter values for calloc: "); for(i=0;i
@Skclubs9882 жыл бұрын
So lovely mam i watching your videos since one year i cleared 3rd year help the ur video❤
@jony-s5m2 жыл бұрын
I love your teaching skill ma'am
@cheharmani13032 жыл бұрын
Gajab padhate ho mam 😍😍🥰 really very nice .
@sheesh70702 жыл бұрын
The way you talk mam...❤️ It's just too much flashy
@VIDITSHRIMALI-l8o2 ай бұрын
lots of thanks and appreciation for the beautiful content just like your beautiful heart
@SakshiPatidar3712 жыл бұрын
Thanku mam Please start python also... Please mam Ur teaching way is awesome Please 🙏
@DevManuel-t6x Жыл бұрын
Thank you first of all for all you have been doing, you have made c programming easy to grasp. I have a question please, some c programmers have raised the argument of typecasting the return value of malloc. They say it is not really right can you please shed more light on that because from my little understanding of C I actually agree with your method of Typecasting.
@efx.69902 жыл бұрын
First view mam😍♥️
@TEJASPLAYZ Жыл бұрын
THANKS 👍👍
@bathinibhargavaram71263 ай бұрын
Thank you so much mam🙏🤗..
@jarpalasony65692 жыл бұрын
Mam could you please upload a video on malloc( ) with structures
@18_ayushmishra622 жыл бұрын
Inhi topic malloc calloc k liye to c dekhna chalu kiya aur 1 mahine se last topic khatm kar k baitha hu aur aj jak ispe video aya
@RiyaRoy-qi6tk2 жыл бұрын
mam why we use calloc ?? what is need of calloc ?? why we need multiple block of memory 😐🤔🤔
@bhanuprasad97882 жыл бұрын
Continue mam never stop
@premwagh94802 жыл бұрын
why i'm reminding to priya gill after watching ma'am😄😄
@DaniyelTutorials2 жыл бұрын
Beautiful Lecture
@hareeshkumar75702 жыл бұрын
Mam I'm from Pakistan and I'm in 1st semester watching your lectures but it is in c language while we are learning c++ so getting some difficulty to understand. Would you please make some lectures on object oriented programming in c++ because we are to Confused in it
@RahulBisht_0012 жыл бұрын
Tumhe bomb banana nahi sikhate 😂😂😂😂
@aryanvyas28362 жыл бұрын
@@RahulBisht_001 bruhh
@sanjays72552 жыл бұрын
Never give up for you dreams bro 👍
@_hindu_warriors2 жыл бұрын
Return to ur motherland hindu boy
@farzanaashraf81362 жыл бұрын
@@RahulBisht_001 😂
@SairamTheegala2 жыл бұрын
ur awesome 💯
@RahulYadav-hr7bx2 жыл бұрын
Mam if possible make a separate video on STATIC variable ,,, because it is very confusing
@therash092 жыл бұрын
static means that the variable (even local) remains for the lifetime of the program and is not destroyed. Its accessibility is limited to the scope where it is defined (like function or file), but its value is not reinitialized during any access after the first access since the variable remains preserved throughout the code lifetime. If you initialize a local variable x in a function as static int x=0, and then increment it by 1 in each call of this function, then your outputs after five function calls will be 1,2,3,4,5. This is because static x retains its value from the last function call and is not reinitialized to 0, since x is not destroyed at the end of every function call. If, however, you declare x as an auto variable by simply doing int x=0, and call the function five times, then your output will be 1,1,1,1,1. This is because the auto variable will be reinitialized to 0 in each function call, as it will have been destroyed at the end of the previous function call. So, static preserves the variable even after your function and its local auto variables have been popped out of stack since static variables are not stored on stack, and therefore remain till the end of the program, thereby retaining their value. So, they behave like global variables but with their accessibility limited to the function in which they are defined. You can expand this understanding to multiple files in a program too. It is good to define variables as static locally to limit their accessibility to the function or file of interest, instead of declaring them as global. Static will preserve the variable values the same way as global, but limit the variable accessibility, which is good!
@Sumit_1522 жыл бұрын
Mam can you teach us competetive programing please
@TanujGutta-r3kАй бұрын
In malloc memory is allocated to single block whereas in calloc multiple blocks are allocated with same memory
@meghanakuppala2 жыл бұрын
Very nice 🙂
@pobbathisuryanarayana37522 жыл бұрын
Malloc with structures make a separate video mam
@asifshinwari15522 жыл бұрын
wow in the black cloths you look so pretty
@CodingKitchen2 жыл бұрын
Thank you
@1shAggarwal2 жыл бұрын
Kal paper hai, or poori c language ki theory , or sab aa rha hai, or ye topic ab dala😔
@navinvenkat34042 жыл бұрын
while i code assignment which was given by mam there is some error while executing it can anybody post that assignment code which was given by mam pls,,
@errorless79212 жыл бұрын
Thanku very much mam
@A_M_A_N7942 жыл бұрын
thanks a lot
@chetnawadhwa43452 жыл бұрын
Thank you mam
@abdulrahimjalloh363 Жыл бұрын
Madam Jenny is Ada Lovelace 2 🥰
@nikithaa.s683 Жыл бұрын
Can you please say why we don't use calloc fuction while dynamically allocating memory for structures
@Vinayvarma_25Ай бұрын
Mam but we can do this like Scanf("%d",&n); a[n]; //instead of malloc mam
@shubhamitaliya3561 Жыл бұрын
amazing
@56vaibhavjadhav362 жыл бұрын
Hii ma'am Data structure and algorithm series is completed or some videos are coming.......
@Euphony_Pro Жыл бұрын
i getting 0 for malloc function also. it is not generating and random garbage values
@surajkumarchaubey2102 жыл бұрын
Nice mam
@udaysinghrana5725 Жыл бұрын
Assignment Question - #include #include void main() { int *ptr,n,i; printf(" How many values for calloc:"); scanf("%d",&n); ptr = (int*) calloc(n,sizeof(int)); for(i=0;i
@abhisheksahu7643 Жыл бұрын
Mam ap vs code ka konsa verson use karti ho
@basuhosur-nh4di Жыл бұрын
Why not coming the garbage value and zero value mam?
@trendingmonkey57592 жыл бұрын
Please tell the syllabus for gate exam mam now I am studying 1st year and I don't know what are the syllabus please help me mam I am from poor family I need to crack gate
@Mohan-im5wrАй бұрын
😊😊
@beautyofnature4757 Жыл бұрын
I love you
@sikiodi52122 жыл бұрын
Mam. Pls upload a topic regarding operator overloading in c++
@nitishgarg6572 жыл бұрын
Mam how many lectures left
@ajaytiwari62862 жыл бұрын
Mam please start java or c++with c
@rphanidattu15152 жыл бұрын
❤️
@swamy562 жыл бұрын
Why calloc intialized with ZERO& where malloc as GARBAGE???
@keerthibindu24552 жыл бұрын
Mam can you right and show me imp points
@dhavalgondaliya87072 жыл бұрын
C language me abhi kitana baki hai ?
@YDK_Edits2 жыл бұрын
Mam...you are so #beautiful ..
@ronycb71684 ай бұрын
Looks like they ran out of names when it came to naming calloc...
@cbcearth50562 жыл бұрын
Maddam will you choose better explaining
@dipoyadav5665 Жыл бұрын
Write a program to multiply given to matrices of order (Mxn) and (PxQ) using pointer Mam makes this program video in c programming
@eiji2.0252 жыл бұрын
Mam Yogi Ji Jeet Gye
@GowripriyaKuncha16 күн бұрын
Not clear view after 10 minutes
@ffdf21952 жыл бұрын
ttttttttoooooooooppppppp
@souviklayek2581 Жыл бұрын
#include #include int main (){ int i,n,*ptr;float*current; printf("Enter the value of n "); scanf("%d",&n); ptr=(int*)malloc(sizeof(int)); printf("Enter the values "); for(i=0;i
@tejhimanshu2 жыл бұрын
#include #include void main() { int *ptr, n, m, i, sum = 0; float *ptr1, avg = 0, avg_sum = 0; printf("enter total no of values for calloc: "); scanf("%d", &n); ptr = (int *)calloc(n, sizeof(int)); if (ptr == NULL) { printf("memory allocation failed..."); } printf("enter values: "); for (i = 0; i < n; i++) { scanf("%d", (ptr + i)); sum = sum + *(ptr + i); } printf("Sum = %d ", sum); free(ptr); printf("enter total no of value for malloc: "); scanf("%d", &n); ptr1 = (float *)malloc(n * sizeof(float)); if (ptr1 == NULL) { printf("memory allocation failed..."); } printf("enter values: "); for (i = 0; i < n; i++) { scanf("%f", (ptr1 + i)); avg_sum = avg_sum + *(ptr1 + i); } avg = avg_sum / n; printf("Average = %.2f", avg); free(ptr1); }
@atifreza46072 жыл бұрын
in alloc also im getting 0 value im not getting garbage value in malloc #include #include // malloc is stands for memory allocation int main(){ int n,*p,i; printf("Enter the no u want to insert "); scanf("%d",&n); p=(int *)malloc(n*sizeof(int)); // printf("Enter the values "); // for(i=0;i
@Manpreet_saini696 Жыл бұрын
// Online C compiler to run C program online #include // Online C compiler to run C program online #include #include #include void main() { int n,i,*ptr; printf("no of values:"); scanf("%d",&n); ptr=(int*)calloc(n,sizeof(int)); printf("values are:"); for(i=0;i
@Tech_Gyan.21 Жыл бұрын
We can't use Integer pointer to store address of floating value.
@abdulrahimjalloh363 Жыл бұрын
Thanks mam
@aparnamane48992 жыл бұрын
Malloc with structures make a separate video mam plz