You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 line
391B

  1. #include "parse.h"
  2. void getFromString (const char* buf, int* n){
  3. *n=atoi(buf);
  4. printf("%d\n",*n);
  5. }
  6. void getFromString (const char* buf, size_t* n){
  7. *n=(size_t)(atoi(buf));
  8. printf("%lu\n",*n);
  9. }
  10. void getFromString (const char* buf, double* n){
  11. *n=(double)(atof(buf));
  12. printf("%15.6e\n",*n);
  13. }
  14. void getFromString (const char* buf, char* n){
  15. sscanf(buf,"%s",n);
  16. printf("%s\n",n);
  17. }