fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main() {
  6. char* buffer = "Hello World 23";
  7. char store_hello[10], store_world[10];
  8. int total_read,dfs;
  9.  
  10. total_read = sscanf(buffer, " %d", store_hello, store_world,&dfs);
  11.  
  12. printf("Value in first variable: %s",store_hello);
  13. printf("\nValue in second variable: %s",store_world);
  14. printf("\nTotal items read: %d",total_read);
  15. printf("\nTotal items read: %d",dfs);
  16. return 0;
  17. }
Success #stdin #stdout 0s 5296KB
stdin
Standard input is empty
stdout
Value in first variable: 
Value in second variable:  
Total items read: 0
Total items read: 2076494624