fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <sstream>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. istringstream filename("lights042.rgbe");
  9. string Name;
  10. int Num;
  11. string File;
  12.  
  13. while(filename && !isdigit(filename.peek())) {
  14. char c;
  15. filename >> c;
  16. Name += c;
  17. }
  18.  
  19. filename >> Num;
  20. filename >> File;
  21.  
  22. cout << "Name = '" << Name << "'" << endl;
  23. cout << "Num = " << Num << endl;
  24. cout << "File = '" << File << "'" << endl;
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
Name = 'lights'
Num = 42
File = '.rgbe'