I am writing a curses program and was wondering if it is possible to declare a multiline string constant like the following:
#define GRID" | |...
Type: Posts; User: Bnchs
I am writing a curses program and was wondering if it is possible to declare a multiline string constant like the following:
#define GRID" | |...
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...
Thanks , for some reason, I had set the file descriptor with a -1.
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...
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...
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...
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...
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...
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....
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 );
Thanks hk_mp5kpdw, I changed
if( X < ( (T->Left)->Element ) )
to
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...
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
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;
...
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...
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.
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...
I found a solution and will post in case someone else encounters the same issue.
Add a %*c to read but not store the comma in between the fields.
sscanf (line, "%[^,] %*c %[^,]
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...
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...
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...
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...
What is the correct/best way to include a template class within another class? Thanks.
I have the following:
template <typename HashedObj>
class HashTable
{
...
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, "%d %d %d %d %d %d %d %d %d %d...
Thanks for your help, that did it.