Add the HRR related function and parameters into LTORC
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.

parse.cpp 391B

4 years ago
1234567891011121314151617181920
  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. }