Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. using namespace std;
  4. char cmd;
  5. void exec(char cmd, FILE *fp);
  6.  
  7. int main() {
  8. FILE *fp;
  9. fp = fopen("test.txt", "r");
  10. while((cmd=getc(fp))!=EOF) {
  11. exec(cmd,fp);
  12. };
  13. fclose(fp);
  14. }
  15. void exec(char cmd, FILE *fp)
  16. {
  17. if(cmd=='>') {
  18. cout << "Pointer" << endl;
  19. getchar();
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement