Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef ANALISER
- #define ANALISER
- #endif // ANALISER
- #include <windows.h>
- #include <string>
- using namespace std;
- class analyser {
- public:
- //char* code = NULL;
- //char *t;
- string *s=NULL, *t;
- analyser();
- };
- analyser::analyser () {
- char c;
- int i = 1;
- FILE * ptrFile2 = fopen("out.txt" , "r");
- while ((c = fgetc(ptrFile2)) != EOF)
- {
- t=s;
- s = (string*)realloc(t, i * sizeof(string));
- if (s == NULL)
- {
- printf("OutMemoryError!");
- exit(0);
- }
- else
- if(t!=s)
- free(t);
- *(s + i - 1) = c;
- i++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement