C is a general-purpose computer programming language used for operating systems, games and other high performance work.

learn more… | top users | synonyms

0
votes
2answers
133 views

Dynamic initialization, how does it work?

I have a question regarding dynamic initialization. Example code void main() { int a = 100; //Statement1 //Statement2 ... float b = 6.32987; //StatementA ... return; } The StatementA allocates ...
0
votes
1answer
113 views

The keyword const and the linker file

If I declare in a header file, for example, extern unsigned long * Ptr; and the value of this pointer Ptr in the linker file. Will this adrress be 'constant'? Can I change its value ?
0
votes
1answer
142 views

Example(s) of “A subscript ([ ]) expression that does not evaluate to an array” in C

I think I have never seen a [] that doesn't mean array in C. Background: I was reading about l-values and r-values here: http://msdn.microsoft.com/en-us/library/bkbs2cds.aspx and there it says so. I ...
0
votes
2answers
466 views

Better design for a generic doubly linked list around which I plan to make different wrappers?

I am currently writing a C code for a doubly linked list(dll) around which I want to write wrapers for implementing stack, queues etc. instead of writing separate codes for all of them. I'll be ...
0
votes
4answers
780 views

How should I go about developing some basic C/C++ knowledge so that I can grok the concepts written in some Classic software programming books? [closed]

I know Java and JavaScript pretty well. I have never really worked on C/C++. But at this stage of my career I feel that the fact that I do not have adequate knowledge on C/C++ syntax(especially ...
0
votes
1answer
507 views

Why nginx's http parser doesnt use regular expressions?

I see the http parser written by Igor Sysoev for nginx does not use regular expressions https://github.com/joyent/http-parser What could be the main reason for such design decision? I guess I could ...
0
votes
3answers
91 views

How to manage intermediate outputs efficiently?

I am implementing a C preprocessor in C... I have the three functions: trigraph replacing function Line splicing function comment removing function However these functions work separately on ...
0
votes
2answers
448 views

How to practice programming? [closed]

I've been a PHP developer for 5 years now. Before I started working in that field, I've been practicing at home. I've created my own CMS, so I could actually show some of my code to the potential ...
0
votes
2answers
476 views

tcp retransmission queue

I'm trying to understand how tcp retransmission queue works so I can implement it in my application that uses TCAP over SCTP. What I understood from the TCP queue is that every message is saved in ...
0
votes
2answers
533 views

Equivalent of common IntelliJ actions in vim for C development [closed]

I am attempting to move from IntelliJ IDEA to vim, primarily for C development. What are the equivalent of the following common IntelliJ features/tasks in vim (and what plugin is required if any)? ...
0
votes
2answers
320 views

Asp.net certification [closed]

I want to get my certification in .NET, which certification is the best for me? For the past 8 months I have been working in the .NET 3.5 and 4.0 frameworks. How can I grow myself by appearing this ...
0
votes
1answer
76 views

How can I handle this string concatenation in C in a reusable way

I've been writing a small C application that operates on files, and I've found that I have been copy+pasting this code around my functions: char fullpath[PATH_MAX]; fullpath[0] = '\0'; ...
0
votes
1answer
151 views

What is this programming style? “Monoid-ic”?

In a moderately old blog post, Conal Elliot makes an interesting (if less than serious) argument that C is a purely functional language, by drawing a parallel between the combination of the C ...
0
votes
1answer
129 views

distributed computing with remote hetrogenous machines

The way i am doing it now is using boost::asio TCP sockets handling everything manually with a main server that orchestrates the processes between the available machines, but the number of machines ...
0
votes
2answers
302 views

What is the exact syntax of inline?

CASE 1 (Definition and declaration in same source file) Suppose both my prototype and definition of global function is in .cpp file. Where should I write inline keyword to make compiler know? In ...
0
votes
1answer
381 views

Multi-threaded server

I have written a server/client program in which I am using 2 threads : One to recieve data continously and Other to send data as the user writes it on screen Problem: I have created the threads ...
0
votes
2answers
258 views

Need some advice and feedback on my code's design

I am looking for feedback on the design of my program. I have a shell script call function.sh that defines a lot of helper functions. My intent is to use those bash functions defined in functions.sh ...
0
votes
1answer
123 views

How do I parse a header with two different version [ID3] avoiding code duplication?

I really hope you can give me some interesting viewpoints for my situation, because I am not satisfied with my current approach. I am writing an MP3 parser, starting with an ID3v2 parser. Right now ...
0
votes
2answers
276 views

WINAPI beginner guidance question

I'm learning to develop windows applications using WINAPI and plain C. Now I got a bit confused with all those handles and would like to ask if you guys could teach me some good practices to structure ...
0
votes
1answer
454 views

Win32 and Win64 programming in C sources? [closed]

I'm learning OpenGL with C and that makes me include the windows.h file in my project. I'd like to look at some more specific windows functions and I wonder if you can cite some good sources for ...
0
votes
1answer
182 views

Reorganizing code based on dependencies

I'm wondering if there is a tool that can generate a dependency graph between C language object files and then analyze how to turn that graph into a DAG by modifying code that creates cycles, moving ...
0
votes
1answer
245 views

Application that provides unique keys to multiple threads

Thanks all for your help before. So, this is what I came up with so far, the requirements are, application has two or more threads and each thread requires a unique session/transaction ID. is the ...
0
votes
1answer
275 views

Programmatically create header file

What's the best way to programmatically create a header file for another project? Here's the specific use case: one program fingerprints the device for discrete information like version number, id ...
0
votes
1answer
155 views

How can I move a library inside a project's source tree and compiling static binaries?

How can I move a library inside a project's source tree and compiling static binaries? I want to use a particular tool that utilizes ANCIENT binaries without upgrading it's API usage. This way I can ...
0
votes
0answers
74 views

Adding Very Large Array's in C. Is there a better way to do this? [migrated]

I am writing a stochastic simulation for a yule process. It basically works likes this if you start with a certain number of bins each containing a random number of balls you add another ball to an ...
0
votes
0answers
48 views

What concept is being exhibited in this macro wrapping? [migrated]

A bunch of code just got handed over to me and I got baffled by macros in the header. I could not understand what they are for: #define WRAPPER_MACRO(symbol) symbol #define ANOTHER_SYMBOL ...
0
votes
0answers
3 views

Creating multiple child processes in C for one parent [migrated]

Everyone! So I've been working on code for my OS class, and in my project, I have to create a new child process for each file on the command line, and pipe information from the child to the parent. ...
0
votes
0answers
2 views

putting file-scope variables inside a struct? What is the benefit [migrated]

As a C developer I always used to place file-scope variables as their own variable. static char myChar; static char *myCharPtr; Now I've started people seeing to be placing these variables inside a ...
0
votes
0answers
5 views

How to write the mexFunction of this c file [migrated]

The function is cyclic.c. void cyclic(float a[], float b[], float c[], float alpha, float beta, float r[], float x[], unsigned long n) // Solves for a vector x[1..n] the “cyclic” set of ...
0
votes
0answers
4 views

C Programming help - providing user with option to exit a program [migrated]

I've written a program to compute the running sum of any numbers input by a user. I need to provide the user with an option to exit the program at any stage, which I'm not sure how to do. I was ...
0
votes
0answers
41 views

wrap mysql API for gui use

Some time ago now, I've written a command-line tool, that connects to MySQL, and through a series of commands, does all sorts of good stuff. It was originally intended to be used by myself and, ...
0
votes
2answers
194 views

Is there a better way to organize my module tests that avoids an explosion of new source files?

I've got a neat (so I thought) way of having each of my modules produce a unit-test executable if compiled with the -DTESTMODULE flag. This flag guards a main() function that can access all static ...
0
votes
1answer
728 views

Best way to quickly explore/grok open source C/C++ projects? [duplicate]

I'm looking for a suggested workflow for quickly being able to download various c/c++ open source projects and then begin intelligently navigate sources. "Intelligently" means being able to jump ...
0
votes
1answer
80 views

Undefined behaviour or precedence question [duplicate]

The following code snippet in C: i=i++; has undefined behaviour according to a book.But my logic is this: Since ++ operator has more precedence than = operator,it should be evaluated first,so i++ ...
0
votes
0answers
174 views

How does a dynamic library's references to a static variable get translated once in the running app?

If a dynamic library exports the address to a global variable defined within the library, how are accesses to that variable translated during dynamic linking so that a running application can interact ...
0
votes
2answers
1k views

Should I use extern global variables or static global variables with “get” and “set” functions in C [duplicate]

I am working on one of my first projects in C (microcontroller code) which is split up into multiple C files. I noticed some inconsistency in my coding where I had some variables declared as extern ...
0
votes
1answer
282 views

I'm trying to create a visual representation of something, but I don't know what words to use, so I'll try to describe it

My project team is making a site that will use reddit style voting to track users' opinions on various issues, and use the data to create a "heat map". I say heat map in quotes because I'm not sure ...
0
votes
0answers
208 views

Which programming language is Curiosity written in? [duplicate]

Possible Duplicate: What is the Mars Curiosity Rover's software built in? I only recently came across an article that stated there was well over 500,000 lines of code in Curiosity and I ...
-1
votes
3answers
1k views

Why are algorithms and data structures important? [duplicate]

It seems like a lot of university-level computer science programs and programmer job interviews focus heavily on algorithms and data structures. I'm curious as to why universities and employers put so ...
-1
votes
2answers
98 views

I'm trying to figure out which functions from one C library are being used by C project. Does anyone have a simple solution? [closed]

To be specific, I want to know which function/types in libpri and being used in the Asterisk project. I'm not traditionally a C programmer, but I know some basic stuff because I took a class in ...
-1
votes
3answers
636 views

Why does an unsigned int compared with a signed character turn out with an unexpected result? [closed]

Why does the following code output y>x when clearly 1>-1? unsigned x=1; signed char y=-1; if(x>y){ printf("x>y"); } else { printf("y>x"); } Please explain this result.
-1
votes
2answers
150 views

Mulitple processes aware of each other

Hope you can help me with this, I've searched a lot and I got really confused of what to do here. I'm building a program in C and I need to run it multiple time as I need. So it's going to be like ...
-1
votes
3answers
960 views

API design pitfalls in C

What are some flaws that drive you nuts in C APIs (including standard libraries, third party libraries, and headers inside of a project) ? The goal is to identify API design pitfalls in C, so people ...
-1
votes
2answers
2k views

Want to create a simple gui app using C++ but dont know what to use [closed]

I have learned C++ to an intermediate point and now I'd like to create something beyond a console program. I would like to create a simple program that grabs info from specific text files and displays ...
-1
votes
2answers
328 views

What is the best programming language to do crypto running time measurement? [closed]

I am trying to measure the running time of different crypto algorithm. e.g. how long it takes to encrypt/decrypt a block of plaintext. May I ask if C with OpenSSL is the best PL to do this?
-1
votes
2answers
389 views

What are the ways to start making actual/real-world programs using Java/C++ to excel my Programming Skills? [duplicate]

Possible Duplicate: How do I improve my coding skills? How I do become a better programmer as a junior developer The programming that we learn at university is not that vast, like those ...
-1
votes
2answers
197 views

How should I group these variables?

I have a shape that will be defined by: char s_type; char color; double height; double width; These variables are scanned in from a request string sent to my server and passed into my printing ...
-1
votes
1answer
183 views

Compile GPL-code into a JNI-capable shared library and use it in commercial software [closed]

I am developing an application for Android in JAVA which calls GPLed C-code via JNI. I have modified & capsulated a GPL-software under a JNI-interface and compile it as a shared library (.so) ...
-1
votes
1answer
63 views

Creating a window to draw pixels in [closed]

I'm creating a fictional architecture and other fictional components for this computer/emulator. I'm facing an issue, this being the virtual display. I need to be able to create a Window in which my ...
-1
votes
1answer
81 views

A Server sending data to be processed to clients [closed]

About a year ago I had an idea in mind which was using my friends computers to help me process my data, so I programmed a socket server application with boost::asio, and gave the client part of it to ...