fork download
  1. #include <stdio.h>
  2.  
  3. void loc_log_chr_track_selection_info(const char *keypressed, const char *trk_name, const char *subdiv_name)
  4. {
  5.  
  6. char loc_record[32 + 25 + 2] = {0};
  7.  
  8.  
  9.  
  10.  
  11. if (trk_name == NULL)
  12. {
  13.  
  14. trk_name = "";
  15.  
  16. }
  17. snprintf(loc_record, sizeof(loc_record), "%s", trk_name);
  18.  
  19. if (subdiv_name == NULL)
  20. {
  21.  
  22. subdiv_name = "";
  23. }
  24. snprintf(loc_record, sizeof(loc_record), " %s", subdiv_name);
  25. printf(" Fenil%sHello",loc_record);
  26.  
  27. }
  28. main()
  29. {
  30.  
  31.  
  32. loc_log_chr_track_selection_info(NULL,NULL,NULL);
  33. loc_log_chr_track_selection_info("key press","trk name","subdiv name");
  34. }
Success #stdin #stdout 0s 5292KB
stdin
10
aba
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
stdout
 Fenil Hello Fenil subdiv nameHello