Search:

Type: Posts; User: csharp100

Page 1 of 8 1 2 3 4

Search: Search took 0.01 seconds.

  1. one last cfg-production to finish yacc project

    Hello everyone, I have a production that is giving me a problem. It turns out to be an array element. I have been given what my output of the AST should be and is as follows:



    begin
    real
    ...
  2. I figured it out. Begin needs to be in the token...

    I figured it out. Begin needs to be in the token declaration with a value:


    %token <i> Ident 1 IntConst 2 Begin 6
  3. YACC abstract syntax tree error: line 47: fatal: must specify type for Begin

    I am working on a YACC file for a compiler independent study. I have received the above error. I am pretty sure the way I am starting off the tree is incorrect and I am not sure how I would correct...
  4. yes and the problem was a semicolon at the end of...

    yes and the problem was a semicolon at the end of the while loop in the scanner code. I inadvertently added one. Habit of the "pinkey" finger.
  5. printf("%c\n", nextChar); Produces the same...

    printf("%c\n", nextChar);

    Produces the same results.
  6. Passing a file pointer to a function is producing undesired output

    Hello everyone,
    I am working on a project and decided to try something simple before I start adding items. I am calling a function from main and that function has a file pointer. Here is my main.cpp...
  7. Sorry oogabooga, he explicitly states, "Building...

    Sorry oogabooga, he explicitly states, "Building the tree (through one function) should be implemented in another source file buildTree.c"
  8. You are correct, they are not fuctions. I did not...

    You are correct, they are not fuctions. I did not word that correctly. The interfaces I am allowed are:


    node_t *buildTree(FILE *)
    void traverseInorder(node_t*)
    void traversePreorder(node_t*)...
  9. I am not allowed any other functions. I have...

    I am not allowed any other functions. I have created a binary tree and completely agree the recursive approach would be much better. But how do you call an interface of:


    node_t *buildTree(FILE...
  10. Unfortunately I am not allowed any other...

    Unfortunately I am not allowed any other functions. I can only have main.c, buildTree.c, traverseInorder.c, traversPreorder.c & traversePostorder.c.
  11. I believe that is what I am asking. To clarify my...

    I believe that is what I am asking. To clarify my file will contains strings like


    joe clint james brint howard
    jimmy
    alexander

    me
  12. Linked list inside an unbalanced BST or linked list inside a linked list c program

    Hello All,
    I am struggling with a linked list inside a BST, basically a linked list inside a linked list. I have completed the BST from a file read using an iterative approach to the BST because of...
  13. I did add -Wextra to my Makefile.

    I did add -Wextra to my Makefile.
  14. Thanks!

    Thanks!
  15. Makefile: CC = gcc CFLAGS = -Wall -c...

    Makefile:



    CC = gcc
    CFLAGS = -Wall -c
    LDFLAGS =
    SOURCES = main.c fileCheck.c buildTree.c traverseInorder.c traversePreorder.c traversePostorder.c
    OBJECTS = $(SOURCES:.c = .o)
    DEPS = main.h...
  16. So are you saying: return NULL; or just ...

    So are you saying:


    return NULL;

    or just


    return;
  17. warning: return makes pointer from integer without a cast

    Hello all,

    I have a function that I want to exit gracefully when an "error" occurs in an input file. My function declaration is:


    BSTnode *buildTree(FILE *fp)


    The few lines that are...
  18. Replies
    3
    Views
    2,168

    I just saw that in my program and came back here...

    I just saw that in my program and came back here to correct it. Kudos and thanks for the reply.
  19. Replies
    3
    Views
    2,168

    Removing trailing character with strtok

    Hello everyone,
    I am having a problem with the output of a file. My function does everything it needs to do with the exception of one line. I have a .dat file with the following:


    joe clint...
  20. Replies
    9
    Views
    1,142

    I do want to count empty lines. I must print an...

    I do want to count empty lines. I must print an error message with the error and which line it occurs on.
  21. Replies
    9
    Views
    1,142

    Got it, see revised code: #include "main.h"...

    Got it, see revised code:


    #include "main.h"

    int fileCheck(FILE *fp)
    {

    int line_count = 0;
    char file[BUFF];
  22. Replies
    9
    Views
    1,142

    No and I compile with gcc -Wall flag. What do you...

    No and I compile with gcc -Wall flag. What do you mean by "broken?"
  23. Replies
    9
    Views
    1,142

    Unix on a Sun Solaris, yes and yes. The problem...

    Unix on a Sun Solaris, yes and yes. The problem was fscanf. It was removed. Thank You.
  24. Replies
    9
    Views
    1,142

    CTL^D not ending my stdin loop

    Can someone explain to me why CTL^D is not ending this loop? My fp has been set to stdin in my main.c Can you also suggest a way that I can do it? Thank You!


    #include "main.h"

    int...
  25. You are correct, but that is not my question.

    You are correct, but that is not my question.
Results 1 to 25 of 179
Page 1 of 8 1 2 3 4