Advertisement
CamolaZ

sscanf Sprintf video

May 31st, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. /* sprintf example */
  2. #include <stdio.h>
  3. #include <string.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     char profile[30];
  9.     char fn[12] = "Cindy", ln[12] = "Crawford";
  10.     int age = 40;
  11.     sprintf(profile, "%s %s -> %d", fn, ln, age);
  12.     printf(" profile %s \n", profile);
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement