c

How to programatically convert a time from one timezone to another in C?

The info pages for the GNU date command contains this example: For example, with the GNU date command you can answer the question "What time is it in New York when a Paris clock shows 6:30am on October 31, 2004?" by using a date beginning with `TZ="Europe/Paris"' as shown in the following shell transcript: $ export TZ="...

How to set a pointer to zero'th location?

As per my knowledge, all occurrences of NULL in code are replaced by a 0 during the preprocessing stage. Then during compilation, all occurrences of 0 in pointer context are replaced by an appropriate value which represents NULL on that machine. Thus the compiler has to know that NULL value for that particular machine. Now, this means th...

Practical to save thousands of data structures in a file and do specific lookups?

There's been a discussion between me and some colleagues that are taking the same class as me (and thus have the same project) about saving data to files and read from those files only when we need that specific data. For instance, the project is something about managing a social network. I'm not going into specifics because it doesn't ...

gcc, make: how to disable fail on warning?

I'm trying to build gcc for use with an AVR micro controller and avr-ada, and I've hit a roadblock caused by my regular compiler being too picky about the version I needed for the AVR. I get the following warning, which in turn causes the gcc or make to report an error: gcc -c -g -O2 -gnatpg -gnata -nostdinc -I- -I. -Iada -I../../gc...

FMOD play overlapping sounds

This may be a build in feature of FMOD, but I'd like to see if i can override it. When playing a SOUND with FMOD_System_PlaySound, FMOD_System_PlaySound( system, FMOD_CHANNEL_FREE, SOUND, false, &channel ) ; (YES I use the C api ;) ) If you've ALREADY started playing SOUND, then what happens is the original one is STOPPED and SOUND ...

Application launch from c command in window OS

I want to make an console application of c which can run other applications (exe files). Kindly guide me how can I make it possible so that from my c code i can run other executable files in window OS. ...

Automatic structure initialisation in c/Linux

I am back into c/Linux. The question might look stupid, but relevant after working in c# etc. I have some structures inside structures and the hierarchy level is more than 5. In such a case, I am doing an initialisation of every structure at the beginning explicitly. I know c does not have a new() method that will do it for you. Now I w...

Problem in CreateProcess function!

Hello all,I have my main application ,from my main application I will be calling another module(third party) to perform a small operation in my main application,when I call that module..it processes for a particular time say 5 sec.while its proccessing it shows the process in the commmand window with some information..now my main applica...

Burning a CD programatically

How can I write something onto a CD using ANSI C working under Windows? ...

Default value of an Objective-C struct and how to test

I'm trying to test if a property has been set yet. I know that with objects that I've got: CGRect ppGoalFrame; LocalPlaySetup *localPlaySetup; and I can test if (localPlaySetup == nil) but if I attempt to test the CGRect with == nil or == NULL if (ppGoalFrame == nil) I get invalid operands to binary == (have 'CGRect' and 'void...

C memset warning

This is my warning. warning: passing argument 2 of ‘memset’ makes integer from pointer without a cast Then i changed as follows (make NULL to 0) Before Change : memset(key, NULL, KEY_BYTES); After Change : memset(key, 0, KEY_BYTES); The warning is removed. i am using linux & gcc compiler,C. Is it correct action ...

Does cscope has search history or search query stack feature?

I usually dig in the c source code with cscope from method to method more than 4-5 level and I have to step between the methods back and forth. How can I see the search history in cscope so I don't have to remember the previous method name. or it will be better if it's a stack. ...

C: Writing and Reading a string to and from a binary file.

I want to store strings in a binary file, along with a lot of other data, im using the code below (when i use it for real the strings will be malloc'd) I can write to the file. Ive looked at it in a hex editor. Im not sure im writing the null terminator correctly (or if i need to). when i read back out i get the same string length that i...

C .pc file warning

This is my warning. warning : implicit declaration of function 'sqlglm' The warning comes in a bi.pc file. when i check the bi.c file. it doesn't include #include <sqlcpr.h> #include <sqlca.h> As .c file generate at compile time. there is no need to edit .c file i am using linux & gcc compiler,C. ...

Creating csv files in ObjC

Hi All, Is it possible or any library available for creating .csv file in ObjC ? Thanks ...

Return an array in c

Hello, I would like to know if there is any way to return an char array. I tried something like this "char[] fun()" but I am getting error. I don't want a pointer solution. Thanks! ...

Spliting the string and displaying it....

Actually,the following program is to split the string and display the output.I have done my program and it is giving the desired output.But,at the end it is giving segmentation fault.I tried with debugger also.But,I was unable to find the problem.can anyone help me? Input File: Vivek|Raj|20 Abi|Nila|20 Expected Output: ...

how to send a byte array through udp using ansi c?

i want to send a byte array on udp through an ansi c program how can we use this. ...

C program to display a jpeg or bmp or pcx file.

What is the code in 'c' to display a picture file like jpeg file or bmp file or pcx file. For example the picture may be available in desktop and the program during execution must be given the path of the file as input and should display the image.(If it is in command line,it'll be excellent). Platform:Windows xp Turbo c compiler(or tu...

How to find a factorial?

How can I write a program to find the factorial of any number? ...