Hi,
For my upcoming university C project, I'm requested to have modular code as C allows it. Basically, I'll have .c file and a corresponding .h file for some data structure, like a linked list, binary tree, hash table, whatever...
Using a linked list as an example, I have this:
typedef struct sLinkedList {
int value;
struct s...
Hi,
Once again, talking about my upcoming university project... I had a class today, where we could ask stuff about the project but I still haven't decided on the best way to do this.
Basically, I have a bunch of users (some struct with a couple of members) which must be quickly searched by name and by SSN. Since I will also need to us...
Hi, I'm looking to follow along with The C Programming Language (Second Addition) on a machine running Vista.
So far, I've found Dev-C++ the easiest IDE to do this in. However, I still have one problem. Whenever I run my compiled code, for example: a simple hello world program, it runs, but the console window just flickers on the screen...
i have this makefile below and in it my includes are
gtk/gtk.h
and
webkit/webkit.h
but when i try to build the project using the make command i have the errors
error: gtk/gtk.h: No such file or directory
error: webkit/webkit.h: No such file or directory
in case the gtk+-2.0.pc and webkit...pc are in the usr/lib/pkgconfig
Make Fil...
Hi!
I'm pretty new to C, and I have a problem with inputing data to the program.
My code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
int a;
char b[20];
printf("Input your ID: ");
scanf("%d", &a);
printf("Input your name: ");
gets(b);
printf("---------");
printf("Name: ...
I have to connect to a remote server via UDP and send a predetermined message to it in order to get a message back. I had first tried this in TCP and it worked but in UDP after I send the message and listen for the reply in recvfrom() I get nothing. Can anyone tell me what might be the problem here.
if ((bytes_sent = sendto(sockfd, UDP_...
If I wanted to convert binary into decimal, is there way I could do this:
Assuming:
newState[i-2] = 0,
newState[i-1] = 0,
newState[i] = 1
binary = newState[i-2], newState[i-1], newState[i]; // but if I did this, bin = 0, not 001.
I want to do this so I can pass binary into another method to convert into decimal.
...
I'm using the Scintilla edit control on Windows (Win32, C/C++) . The control is created in WndProc. I have a second thread, created with Boost.Thread, that act as a spell checker and marks with red squiggle incorrectly spelled words. Therefore, I have two threads altering the content of the Scintilla control.
At first, the program was ...
Possible Duplicate:
Could anyone explain these undefined behaviors (i = i++ + ++i , i = i++, etc)
In Java the evaluation order is specified to be left-to-right. Is this the case for C and C++ as well, or is it implementation dependent? I do remember that the evaluation order is unspecified for function arguments, but what ab...
Can we write a c program to find out time spent in context switch in Linux? Could you please share code if you have one?
Thanks
...
The following code snippet is from The Official GNOME 2 Developer's Guide:
GMemChunk my_chunk;
my_chunk = g_mem_chunk_new("My Chunk",
42,
42*16,
G_ALLOC_AND_FREE);
gchar *data[50000];
gint i;
/* allocate 40,000 atoms */
for(i = 0; i < 40000; i++)
{
data...
VB6 CreateObject() is advising this error msg:
"Automation Error" - "Not enough storage is available to process this command"
The object being created is a DLL written in C. I'm running the application that's trying to create the object on my machine, and the object itself is being created on my machine also.
I'm running Windows Vi...
Hi all,
I'm having some problems with my program in VS .NET 2003.
I initially wrote a module that uses the pthread library to create a number of threads to process something. This runs correctly in VS .NET 2003. Then this module was used by someone else and integrated into another larger program. I'm not sure about the details, but th...
Hi,
I basically have a server set up and I'm accepting new clients(UNIX) and i'm using select() command to wait for activity on file descriptor but I'm not sure how to write from the clients side and then read it on the servers side
FD_ZERO(&readfds);
FD_SET(server_sockfd, &readfds);
FD_SET(STDIN_FILENO, &readfds);
while (1) {
test...
Hi,
I was writing some codes in linux using c. When tried to compiled, I got this response:
/tmp/ccW8mQDx.o: In function `main':
server.c:(.text+0x3e): undefined reference to `__gmpz_set_str'
server.c:(.text+0x5a): undefined reference to `__gmpz_set_str'
In fact, all the functions of gmp that I used couldn't be found.
Seems there ar...
Hi,
If I have a texture, is it then possible to generate a normal-map for this texture, so it can be used for bump-mapping?
Or how is normal maps usually made?
Sandra
...
can we declare a function in a header file in following way?
extern int ap( char[][] );
can we use char[][] in function?
...
Hi,
I have 2 threads and global Queue, one thread (t1) push the data and another one(t2) pops the data, i wanted to sync this operation without using function where we can use that queue with critical section using windows API.
The Queue is global, and i wanted to know how to sync, is it done by locking address of Queue?.
Answers wil...
Referring to the O'Reilly pocket reference for C, I'm a little confused by the description for grouping of the *, /, and % operators. The book says that grouping occurs left to right -- now I think I'm getting grouping confused with evaluation order. Given the following equation, and the rules established from the book, I would have thou...
What are the pro cons with having delegates having a reserved definition type.
For example in c if I want to define a function that takes a pointer to a function I can simply define
void F(bool (*pFn)(int));
In c# I have to take the extra step of first defining the delegate type similar if I had to create a typedef in c before I cou...