Search:

Type: Posts; User: Bnchs

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    2,013

    Multiline strings

    I am writing a curses program and was wondering if it is possible to declare a multiline string constant like the following:



    #define GRID" | |...
  2. Thread: select()

    by Bnchs
    Replies
    0
    Views
    1,505

    select()

    I am writing two different terminal programs that will communicate with each other via named pipes. The client will have to read from two input sources: stdin and its read fifo, and likewise for the...
  3. Thread: "bus error"

    by Bnchs
    Replies
    2
    Views
    3,536

    Thanks , for some reason, I had set the file...

    Thanks , for some reason, I had set the file descriptor with a -1.
  4. Thread: "bus error"

    by Bnchs
    Replies
    2
    Views
    3,536

    "bus error"

    I am trying to write a server program and a client program that can communicate with eachother. I am trying to use the select() system call to be able to read from the terminal as well. I have...
  5. Replies
    2
    Views
    1,265

    Function Parameter causing syntax error

    When I try to compile my program, the compiler generates the following error:

    "In file included from avl_tree.h:6, from avl_tree.c:1: callbacks.h:13: error: syntax error before "Application"

    I...
  6. Replies
    4
    Views
    1,856

    I am still working on this problem and can't get...

    I am still working on this problem and can't get it working. Is it true that every time (in this case) that Insert() is called, the call is placed on the stack where the most recent call is handled...
  7. Replies
    4
    Views
    1,856

    I didn't want to post all of the code because it...

    I didn't want to post all of the code because it is long. The other part is symmetrical, but here it is:



    struct AvlNode* Insert( gint X, struct AvlNode* T )
    {
    static struct...
  8. Replies
    4
    Views
    1,856

    Help with AVL Tree Pointers

    I am trying to get a pointer to a node's parent within the recursive insert function. Normally, this would not be necessary, but I am writing a graphical AVL Tree and need to have the info from the...
  9. Replies
    9
    Views
    3,384

    Thanks for all of your suggestions. I went ahead...

    Thanks for all of your suggestions. I went ahead and changed things to have a pointer to an avlNode struct and everything is working as it should. The code is also clearer and easier to understand....
  10. Replies
    9
    Views
    3,384

    I am now having two problems that I cannot fix: ...

    I am now having two problems that I cannot fix:



    *T->Right = Insert( X, *T->Right );

    Crashes the program. When I change it to


    T->Right = Insert( X, T->Right );
  11. Replies
    9
    Views
    3,384

    Thanks hk_mp5kpdw, I changed if( X < (...

    Thanks hk_mp5kpdw, I changed



    if( X < ( (T->Left)->Element ) )


    to
  12. Replies
    9
    Views
    3,384

    How to access members of a struct

    I have been trying to figure out how to access the members of a struct, but have been unsuccessful. The compiler is generating the error:

    "request for member `Element' in something not a structure...
  13. Replies
    8
    Views
    6,135

    Thanks matsp. I also just figured out what the...

    Thanks matsp. I also just figured out what the problem was.



    term_attributes.c_lflag &= ~ECHO ;
    term_attributes.c_lflag &= ~ICANON;
    term_attributes.c_lflag &= ~ISIG;


    should be
  14. Replies
    8
    Views
    6,135

    I have gone through the mode bits again, but the...

    I have gone through the mode bits again, but the program is not detecting ^c. Here is the part of the code:



    term_attributes.c_lflag &= ~ECHO ;
    term_attributes.c_lflag &= ~ICANON;
    ...
  15. Replies
    8
    Views
    6,135

    I have to write a simple line editor that is in...

    I have to write a simple line editor that is in non-canonical mode, thus the program has to process the input instead of the terminal. In my program, ^C among others has to do specific things with...
  16. Replies
    8
    Views
    6,135

    Using fgetc() to read control characters

    I am unable to read control characters from stdin using fgetc(). Are there ascii codes for things like ^c (ctrl-c) that I can use to compare the return value of fgetc() with? Thanks.
  17. Replies
    0
    Views
    1,683

    Topological Sorting

    I am thinking about the problem of topological sorting, and am stuck with the following question:

    How many different topological orderings does a graph G = (V,E) have if E is the empty set?

    Is...
  18. Replies
    8
    Views
    2,078

    I found a solution and will post in case someone...

    I found a solution and will post in case someone else encounters the same issue.

    Add a &#37;*c to read but not store the comma in between the fields.



    sscanf (line, "%[^,] %*c %[^,]
  19. Replies
    8
    Views
    2,078

    I have been trying several different things, but...

    I have been trying several different things, but have been unable to extract the data from the file correctly. I printed the return value of sscanf, and it read only 1 string from the line. So the...
  20. Replies
    8
    Views
    2,078

    I am now writing another program, but have a...

    I am now writing another program, but have a similar question about sscanf. I want to read a line from a file in the form:

    lastname firstname, 123 Fake ST, 1 , Somewhere, US, 0000

    My problem...
  21. Replies
    5
    Views
    1,299

    Help Dynamically allocating a struct

    I am programming in GTK using C and need help solving a problem I have. I am writing a simple program that shows student records. The problem is that I would like to create "student" struct objects...
  22. Replies
    2
    Views
    1,501

    Template Class as a friend of another class

    What is the correct/best way to include a template class within another class? Thanks.

    I have the following:



    template <typename HashedObj>
    class HashTable
    {
    ...and want to include it...
  23. Replies
    0
    Views
    1,380

    Template class within another class

    What is the correct/best way to include a template class within another class? Thanks.

    I have the following:


    template <typename HashedObj>
    class HashTable
    {
    ...
  24. Replies
    8
    Views
    2,078

    One of the lines in the file will always contain...

    One of the lines in the file will always contain only 12 integers. How can I loop the following code to insert each integer read into an array.



    sscanf (line, "&#37;d %d %d %d %d %d %d %d %d %d...
  25. Replies
    8
    Views
    2,078

    Thanks for your help, that did it.

    Thanks for your help, that did it.
Results 1 to 25 of 56
Page 1 of 3 1 2 3