No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I'm trying to use GNU flex to write a lexical analyzer. Is it possible to have multiple definitions for the same name in Flex? Like this: /* DEFINITIONS */ FRUITS "APPLE" | "ORANGE" | "LEMON" Also, what can we do and not do with string constants in flex's regular expressions? … |
|
I'm having trouble opening a file using fopen in C++. I'm using XCode 4. Here's my code: FILE *f; f = fopen("test.txt", "r"); if (f == NULL) std::cout << "Error: NULL file"; When I run this, the error message gets printed. test.txt is stored in the same directory as my … |
|
Hi, I'm trying to write a function that enlarges a dynamically allocated array, but I am having some trouble doing so. Here's my code: void enlargeArray(int *oldArr, int arraySize) { //oldArr is a dynamically allocated array int *newArr = new int[arraySize*2]; //copy the elements from oldArr into newArr delete oldArr[]; … |