c

receiving strings through interop

I'm having trouble getting a string back from some c code I wrote. First some generally unrealated background info: I'd like to receive the user readable string for a TAPI TSP from the TAPI API. I've implemented a semi workable TAPI solution relying on matching driver names to stored strings, but would like to change this to work on per...

Manually sort a linked list in the C programming language

How do you sort a linked list by name in a function in C? struct rec{ char name[20]; int nr; struct rec *nextRec; }; typedef struct rec Rec; /* synonym for struct rec */ typedef Rec *RecPtr; /* synonym for pointer */ void SortLinkedList(RecPtr *sPtr, int p_size);/* prototype */ int main() { RecPtr startPtr = NULL; /...

evolution plugin for crm integration via webservices

I have built a webservice into my companies self developed CRM system that we are in the process of integrating Outlook to the CRM for calendar sync and recording of emails related to clients. I want to build a plugin for the gnome evolution mail client as I use it for my work mail/calendar as I primarily run Linux. I am familiar with ...

Determine whether process output is being redirected in C/C++

I'm writing command line utility for Linux. If the output (stdout) is going to a shell it would be nice to print some escapes to colorize output. But if the output is being redirected those bash escapes shouldn't be print, or the content might break parsers that rely on that output. There are several programs that do this (suck as ack) ...

GCC, ARMboot - Creating standalone application without any library and any OS

I have an embedded hardware system which contains a bootloader based on ARMboot (which is very similar to Uboot and PPCboot). This bootloader normally serves to load uClinux image from the flash. However, now I am trying to use this bootloader to run a standalone helloworld application, which does not require any linked library. Actuall...

Looking for GD tutorial in C/C++

I see a lot of GD tutorials for PHP, even though GD was written in C, not PHP. Could you please suggest any good tutorial for GD in C? ...

Why C is the language of compilers- when a Scheme subset would seem to be a better fit?

I was just listening to episode 57 of Software Engineering Radio (TRANSCRIPT: http://www.se-radio.net/transcript-57-compiletime-metaprogramming ) I'm only 40 minutes in, but I'm wondering why C is the language of compilers- when a Scheme subset would seem to be a better fit? (or some other HLL) (excluding the obvious reason of not wanti...

C: mathematical power operator not working as expected

short sho1, sho2; printf("Enter two shorts.\n"); scanf("%hd %hd", &sho1, &sho2); printf("%hd^%hd is %hd.\n", sho1, sho2, sho1^sho2); When I enter '2 2', I get this output: 2^2 is 0. How come? I'm using the MinGW GCC compiler in Eclipse, in case that's of any importance. ...

List of standard header files in C and C++

Where could I find the list of all header files in c/c++? While I am building a library I am getting an error like tree.h not found. I suppose this is a standard header file in c/c++. This raised in me the curiosity to know all the header files and their contribution. Is there a place I can search for? I am working on Solaris Unix. ...

Eclipse: choosing a default debugger for all new C projects

Whenever I start a new project, I have to go through setting up the debugger with Eclipse time and time again before I can use it. Isn't there a default setting for all new C projects I can change? ...

C Programming : how do I read and print out a byte from a binary file?

Hello, I wish to open a binary file, to read the first byte of the file and finally to print the hex value (in string format) to stdout (ie, if the first byte is 03 hex, I wish to print out 0x03 for example). The output I get does not correspond with what I know to be in my sample binary, so I am wondering if someone can help with this...

Logic differences in C and Java

Compile and run this code in C #include <stdio.h> int main() { int a[] = {10, 20, 30, 40, 50}; int index = 2; int i; a[index++] = index = index + 2; for(i = 0; i <= 4; i++) printf("%d\n", a[i]); } Output : 10 20 4 40 50 Now for the same logic in Java class Check { public static void main(String[] ar) { int ...

What happens to an open file handler on Linux if the pointed file gets moved, delete ....

Hi, What happens to an open file handler on Linux if the pointed file meanwhile gets: Moved away -> Does the file handler stays valid? Deleted -> Does this lead to an EBADF, indicating an invalid file handler? Replaced by a new file -> Does the file handler pointing to this new file? Replace by a hard link to a new file -> Does my fil...

Bind Error 10038 with windows socket application in c.

I am testing out a Socket Server application in c and I am getting an error on the bind function with code 10038. I looked this up and MSDN says it means: An operation was attempted on something that is not a socket. Either the socket handle parameter did not reference a valid socket, or for select, a member of an fd_set was not valid....

Correct way to read a text file into a buffer in C?

I'm dealing with small text files that i want to read into a buffer while i process them, so i've come up with the following code: ... char source[1000000]; FILE *fp = fopen("TheFile.txt", "r"); if(fp != NULL) { while((symbol = getc(fp)) != EOF) { strcat(source, &symbol); } fclose(fp); } ... Is this the correc...

Why does this code snippet compile ?

Why does the following code compile? #include <stdio.h> int main(void) { getchar; } ...

Dictionary Matching / Spell Check Program

Please help me with a spellcheck program in C. The majority of the coding are complete (I think...). I'm really stuck because I'm not sure why the program wouldn't compile. Admittedly, I'm still an amateur coder, would you also provide a few suggestions on some of the bad coding habits that I have in the code? Thank you! Error Message: ...

Thread Safety in C

imagine I write a library in C. Further, imagine this library to be used from a multi-threaded environment. How do I make it thread-safe? More specific: How do I assure, that certain functions are executed only by one thread at a time? In opposite to Java or C# for example, C has no means to deal with threads/locks/etc., nor does the C ...

Retrieve YouTube video format available

I'm currently trying to patch the Totem Youtube plug-in and I'd like to determine the best quality available for the current played video (&fmt parameter). It's possible in JavaScript but the plug-in is developped in C. Is that possible? ...

system() function opens a window

Possible Duplicate: Supress console when calling system in c++ When i use the system() function (using C language) in a GUI application on Windows, a console window appears. How can i disable this? ...