Answers for "sscanf in c"

C
0

sscanf in c

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main () {
   int day, year;
   char weekday[20], month[20], dtm[100];

   strcpy( dtm, "Saturday March 25 1989" );
   sscanf( dtm, "%s %s %d  %d", weekday, month, &day, &year );

   printf("%s %d, %d = %s\n", month, day, year, weekday );
    
   return(0);
}
Posted by: Guest on March-02-2021
0

ltoa in c

ltoa() function in C language converts long data type to string data type.
Syntax for ltoa() function is given below.

------------------------------------------------------
    
    char *ltoa(long N, char *str, int base);
Posted by: Guest on July-12-2020
0

fputs in c

#include <stdio.h>

int main () {
   FILE *fp;

   fp = fopen("file.txt", "w+");

   fputs("This is c programming.", fp);
   fputs("This is a system programming language.", fp);

   fclose(fp);
   
   return(0);
}
Posted by: Guest on July-11-2020
0

sscanf in c

March 25, 1989 = Saturday
Posted by: Guest on March-02-2021

Code answers related to "C"

Browse Popular Code Answers by Language