c

Extracting strings from a xml file and pasting them to a text file

Hi, I am trying to extract data from a xml file, get rid of the xml tags, and store the values in a txt file (tab delimited format) using C. I was able to extract and manipulate the string but I am unable to paste the string to the txt file in a tab delimited format. Instead of getting a txt file that should read like: x.xxxxxxx ...

Xoreax Incredibuild alternatives ?

Hi guys, Does anyone knows if there are some alternatives for the Xoreax Incredibuild, this tool is powerful but also too expensive for me. I have project written in c/c++ with about three hundred thousand lines of code and using VS2005 to compile my code is just awfully slow. Thanks to everyone. ...

c printf signed float

What is the formatter to make sure that + or - signs are always shown in front of the float value in printf() in C? I haven't done C in a while, so where can I find a good reference on the web, any suggestions are appreciated ...

C Programming: limited time to search

I'm creating a C program to play Gomoku. It uses Minimax search to decide on the best move. However, it can only search for the best move for 10 seconds. How to I determine when my search function has spent 10 seconds searching. If you could provide me with either an example or a link to the documentation that would be much appreciated. ...

isdigit() Segmentation Fault

Getting a weird segmentation fault on following code when I try to pass a number into my application on command line. int offset = 3; int main(int argc, char *argv[]) { // Check for arguments to see whether there is a custom offset if (argc == 2) { // If argc == 2 then we have a offset? if (isdigit((unsigned cha...

Assigning an address to a struct pointer array member in C.

Having considerable trouble with some pointer arithmatic. I think I get the concepts (pointer variables point to a memory address, normal variables point to data) but I believe my problem is with the syntax (*, &, (*), *(), etc.) What I want to do is build dynamic arrays of a custom struct (i.e. arrays of pointers to heap structs), and ...

Output Redirection in C shell

I asked about pipes in a previous question, got that working perfectly. However I had some questions about output redirection like >> in a shell normally does. There doesn't seem to be a whole lot of info on the Internet about it. Here is what I have so far. Is there a better/easier way to do this, it's messy and im not even super sure t...

In C99, is f()+g() undefined or merely unspecified?

I used to think that in C99, even if the side-effects of functions f and g interfered, and although the expression f() + g() does not contain a sequence point, f and g would contain some, so the behavior would be unspecified: either f() would be called before g(), or g() before f(). I am no longer so sure. What if the compiler inlines t...

What would be a good open source lightweight c library with basic utility functionality to use in an embedded system

I'm thinking of something like glib, but possibly a slim version with a minimal foot print. It would need basic utilities such as linked lists, vectors and hash tables. It should also have a minimal runtime footprint. ...

How to assign address of function pointer according to char*?

Hello everyone! I am writing a C program that could be simplified if I manage to do something like this: int (*func)(int); char* str= "adder"; func = str; func(2); I create a function pointer, a char*, and I try to assign the name of the function to the pointer through that char*. In this example, the adder(int) function exists. Is ...

Why am I getting 'Incompatible pointer type' warning?

I'm working through the curve to learn C and I don't understand why compiler is reporting this this warning. I have a char* that is declared in global space (outside of any function). I want to read a file descriptor and return it's contents to the calling code. At the top of the file I have the buffer declared: char * buffer[256]; ...

Send click to custom control in applet window

Would it be possible send a click message using SendMessage to a control in parent window? Apparently, the following doesn't seem to be working SendMessage(hParent, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(x, y)); SendMessage(hParent, WM_LBUTTONUP, 0, MAKELPARAM(x, y)); //x and y are location of child control on parent applet window. ...

How do make an array that fits string from stdin?

I am trying to use 'gethostbyname'. If I hardcode a host name directly into the function call it works great. However, I am trying to pass user input into this function. I believe my problem may because the array I am passing to the function has many trailing whitespaces. void connectHost(char *hostname) { int n; //This ...

Why can't this program work?

clock_t a = 0; clock_t b = 100; while(a<b) { // get current time a = clock(); } It seems that it is an infinite loop. Can the while loop be broken out of? ...

Array of Linked lists on disk

I am trying to find how to store and process (search, add, remove) an array of linked lists on disk. For example in memory, it would like struct list { int a; struct list *next; }LIST LIST *array[ARRAY_SIZE] int main{ ... LIST *foo = array[pointer]; /* Search */ while(foo!=NULL){ ... foo=foo->next } } I believe that by ...

How to show arbitary characters in c?

warning C4566: character represented by universal-charac ter-name '\u2E81' cannot be represented in the current code page (936) Sometimes we need to display text in various languages such as Russian,Japanese and so on. But seems a single code page can only show characters of 1 single language ,how can I show characters in var...

ExecutionEngineException thrown when calling native code

Hi, I have a function that is exported by a C library with the following signature: extern "C" BOOL Func() The function is declared in VB.NET code like this: <DllImport("mylib.dll", CallingConvention:=CallingConvention.Cdecl)> Private Shared Function Func() As Boolean End Function The problem is that I get an ExecutionEngineExcept...

What is the sscanf placeholder for uint8_t types?

What is the sscanf placeholder for uint8_t types? I tried %u, but gcc under OS X doesn't like it. ...

What does ~ operator do?

I recently saw the above operator in a code,I googled for it but found nothing.The code is below.Please describe what actually does this operator do? #include<stdio.h> int main() { unsigned long int i=0; char ch; char name1[20],name2[20]; FILE *fp,*ft; printf("ENTER THE SOURCE FILE:"); gets(name1); printf("E...

representation of negative numbers in c?

How does c represent negative integers! Is it by 2's complement representation or by using the msb? -1 in hexadecimal is ffffffff. So please clarify me in this regard. ...