Thank you for you're help!
And yes I was warned against using the gets function.. I changed it to scanf! Thank you!
User Profile
Collapse
-
File Handling in C
Code:#include<stdio.h> #include<string.h> main() { FILE *f1,*f2; char str[10]; f1=fopen("file1.dat","w"); printf("Enter contents of file 1 :"); gets(str); fputs(str,f1); fclose(f1); f1=fopen("file1.dat","r"); f2=fopen("file2.dat","w"); fputs(str,f2); fclose(f1);
-
-
Trouble understanding "Double" Pointers.
I am a student and I am having trouble understanding Dynamic Memory Allocation and the usage of Double Pointers.
Code:int **A A=(int **)malloc(r1*(sizeof(int*))); for(i=0;i<r1;i++) A[i]=(int *)malloc(sizeof(int)*c1)
My question : What does the malloc function do here? I know malloc()...
No activity results to display
Show More
Leave a comment: