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

learn more… | top users | synonyms

1
vote
1answer
178 views

Is learning different programming languages from different categories good? [closed]

I have read some posts regarding learning different programming languages or not. Most of the answers indicate that learning more than one programming language increase our horizon as a programmer and ...
1
vote
1answer
125 views

Implementation defined behaviour changing const type in c

The C standard states that if an attempt is made to change a const type,the result is implementation defined.This gives error on my system,but what does it depend on(compiler,os)? What are the ...
1
vote
1answer
295 views

Handling timeout in network application

How can I handle timeouts in a network application. I'm implementing a provisioning system on a Linux server, the code is huge so I'm going to put the algorithm, it works as like this Read ...
1
vote
1answer
302 views

Portability: Python's C/C++ libraries/extensions vs JRuby's Java libraries

I've had some discussion with colleagues who chose to go with JRuby along the following line of argumentation: JRuby can make use of anything that is available in Java, ergo such programs are more ...
1
vote
1answer
180 views

Implementing a sort of navigation system

So I am undertaking a project which does navigation sort of thing. So here is how the problem statement looks like. Say, given a map of a floor, with different rooms, now somehow, this information is ...
1
vote
3answers
274 views

Random List of numbers in C

I have just started a C programming course and so far have only done the basics like printf, read a little on variables etc on the course book. The teacher has tasked us with writing a program that ...
1
vote
2answers
246 views

Function calls to calls in windows api

I am a beginner programmer who is learning C. I find it hard to grasp the whole programming concept, thus I have questions. When programming in Windows, how does Windows communicate with the programs ...
1
vote
1answer
138 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 ...
1
vote
5answers
881 views

Is Operator Overloading supported in C

Today when I read about the LCC (Windows) compiler, I found out it has the implementation for operator overloading. I'm puzzled because after a bit of Goggling, it has been confirmed that operator ...
1
vote
1answer
252 views

hash with file instead of array

Is it possible to use hash function but with File instead of Array, and it's gonna be saving the record in a file position and then search will fseek to that position, but I'm not sure how to open a ...
1
vote
3answers
523 views

timers with threads on queue

So I've been asking the wrong questions for the last three days and after searching a lot I think I have an idea of what I need, my question is how to use timers with two threads writing and reading ...
1
vote
1answer
321 views

Sharing SCTP connection with multiple threads

I have an application that needs to run in SCTP environment, I have a question in sharing the connection among multiple threads for packet receiving only, I've tried with the sctp_sendmsg and it ...
1
vote
2answers
3k views

How can I do test automation using a python script to test a c program?

I was wondering if I can use a Python script to test a C program automatically. Suppose I have a very simple C program which reads data (numbers as test cases) from the console, calculates them, then ...
1
vote
2answers
263 views

Shared memory multiprocesses

I'm building an multi processes application and I need to save session ID, the sessions ID is 32 bit, and of course it can't be used twice in its lifetime, I'm currently using DB that saves all the ID ...
1
vote
1answer
428 views

Going further with C for iOS development

I am an experienced iOS developer amongst other things. I have a good mastery of Objective-C and Apple's frameworks in the language. But when it comes to the C-based frameworks I often hit a ceiling ...
1
vote
1answer
1k views

LUA vs Shell scripting vs C for cgi-scripting on embedded devices

I am going to try CGI scripting for implementing a web based Graphical User Interface on an embedded device. What advantages does LUA scripting have over shell scripting or C for implementing dynamic ...
1
vote
0answers
65 views

Is conversion from C/C++ to Verilog/VHDL for FPGA a derivative work? [duplicate]

Say I have a C/C++ software licensed under GPL that gets converted into hardware design. By this conversion I mean that the exact functionality of the original software is being programmed into an ...
1
vote
0answers
238 views

using flat file vs sqlite db for frequent data grabbing in a cron job

I have some automated task to be done using certain types of logs generated on the server end of each day. Log files contains specific machine identification "MAC" that is to be re-written in to ...
1
vote
0answers
149 views

How to extract the active code path from a complex algorithm

I have been puzzled lately by an intruiging idea. I wonder if there is a (known) method to extract the executed source code from a large complex algorithm. I will try to elaborate this question: ...
1
vote
1answer
123 views

structure problem in Relational DBMS creation

For learning and understanding purpose, I currently want to try to make a small relational DBMS with simple features like (for now) only sequential reading/writing and CREATE TABLE, INSERT, SELECT, ...
1
vote
2answers
410 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 ...
1
vote
1answer
64 views

In GSL, why do some functions take a “workspace” argument?

In certain functions in GSL (GNU Scientific Library), some functions take a "workspace" environment as an argument. For example, gsl_poly_dd_taylor from this page. Why? Wouldn't it be easier for ...
1
vote
1answer
584 views

Multiple readers on FIFO

I've asked a question here before about multiple writers on a FIFO, and I know now that the write is thread safe as long as I write less than the PIPE_BIF, here is the link for that limit. What about ...
1
vote
0answers
16 views

Database lock on gSoap server during storing data in table [duplicate]

Possible Duplicate: How to run thread if multiple data is insert in the multiple table I am getting the values from the android app & storing onto the server using sqlite. first time ...
1
vote
2answers
824 views

MySQL with mutiple threads and processes

I'm developing a telecom messaging platform in C, and I'm going to need multiple processes to be working with MySQL DB. How can I make two processes read/write to/from a Mysql DB and, if/when one of ...
1
vote
0answers
121 views

Online Code Reviews [duplicate]

Possible Duplicate: Website for code review Where can I post my code online so people can comment, make suggestions, and/or criticism? I tried 4chan but people lose interest fast if you ...
1
vote
0answers
937 views

How to start with 2d or 3d modeling? [closed]

My goal is that i can show fractals either into a plane or an space... I thought opengl is the best beggining, but which is the best book oriented to "maths" and "maths graphics"? Red book? ...
1
vote
5answers
301 views

How to alter the code at runtime in an interpreter?

While reading the difference between Compiler and interpreter , I found the following differences fromt he internet. Advantages of using compiler: Since compiler converts the program to native code ...
0
votes
10answers
3k views

Python is slowly replacing C in universities. Does this move degrade the quality of CS students? [closed]

I believe learning C is one of the most important aspects for any programmer. It's a beautiful combination of a high and low level language. Some universities are moving to stop teaching C in the ...
0
votes
4answers
671 views

Why would a C executable be smaller when compared to C++ executable

I'm trying to understand why the output file sizes are significantly different when using a C and a C++ compiler. I was writing a small hello world program in C and C++, I noticed that in C version, ...
0
votes
5answers
1k views

Options other than C for embedded projects? I hate the preprocessor [closed]

C is an awesome simple language perfect for close-to-hardware programming, but the preprocessor sucks in comparison to modern languages. Is there an alternative/add-on to the c preprocessor that ...
0
votes
2answers
2k views

Can anyone explain representation of float in memory?

This is not duplicate question as I read the previous question. Can anyone help me in understanding how float values are stored in the memory . My doubt is here float values contain '.' (for example ...
0
votes
3answers
443 views

Why are there so few comments in C/C++ code? [closed]

I'm a web developer primarily, and I've been learning C/C++ and trying to get involved in some open source projects. Something I find very unusual is the lack of comments in C/C++ source code (I've ...
0
votes
2answers
1k views

Why is C++ preferred over C for commercial applications? [closed]

I program in C mostly. However, it is pretty obvious that many more commercial applications are done in C++. As far as I can tell, C++ is a very complex language, with seemingly convoluted syntax and ...
0
votes
10answers
957 views

Why does the instruction “do” require a “while”? [closed]

Since this statement is so common: while (true) (Java) or while (1) (C) or sometimes for (;;) Why is there not a single instruction for this? I could think that an instruction that could do it ...
0
votes
4answers
757 views

Read K&R before learning low latency C++?

I have never really done a large amount of C programming but am in the middle of teaching myself low latency C++. Would it do more harm than good to read the K&R C programming book? I am a bit ...
0
votes
2answers
582 views

Languages implemented in Python?

AFAIK, Scala and Clojure are implemented in Java and Java is implemented in C. I suppose that many or most languages are implemented in C, for instance Perl, Python and SQL. I don't know much about ...
0
votes
3answers
3k views

How to create interest in programming? [closed]

I am student of 3rd year software engineering, and I find myself nowhere in field of programming. I know basics of programming languages like C, C++, Java, Visual Basic, HTML, JAVAScript, CSS and ...
0
votes
1answer
3k views

What are C's advantages over OOP languages, other than performance? [duplicate]

Possible Duplicate: When to use C over C++, and C++ over C? C still has its own importance in the programming world! And one reason for it is its performance. But, I have some questions. ...
0
votes
3answers
682 views

Get system info from C program?

I'm writing a little program in C that I want to use to output some system stats to my HD44780 16x2 character display. The system I'll be working with is a Debian ARM system and, although irrelevant, ...
0
votes
1answer
751 views

Having trouble understanding recursion [duplicate]

I have just started learning about recursion but I'm having a hard time understanding it. Please would you recommend any links or books that explain recursion in detail.
0
votes
4answers
528 views

How does using #define for loop and condition bounds in C increase security?

My program uses the following define statements: #define LOWEST_PATIENT_ID 10000 #define HIGHEST_PATIENT_ID 99999 #define LOWEST_CRITICAL_STATUS 1 #define HIGHEST_CRITICAL_STATUS 100 used in this ...
0
votes
2answers
4k views

Is there a canonical book on C Programming in GNU/Linux? [closed]

I am looking for a good ebook (or two) for learning the C programming language, specifically programming in a GNU/Linux environment. I'm not a beginner programmer, but I have almost no experience in ...
0
votes
5answers
147 views

What conclusion to be drawn from no difference in generated assembly from 2 rather different programs?

I might not have had a counterexample when I got the reply "A pointer is just an address, what's the difficulty?" but I didn't really buy such a simple explanation and at assembly code it's not ...
0
votes
3answers
1k 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 ...
0
votes
3answers
99 views

Does it make sense to have a separate init function?

I'm created an opaque type and I have two options for its management. The first looks like this: type_t *a = type_init(); int err; err = type_do(a, "foo", "bar", FLAGBIT1|FLAGBIT2, NULL); if (!err) ...
0
votes
3answers
161 views

Use of malloc in C

Is it necessary to call free function every time we use malloc in C. I am asking this because I have seen many times that it is not called . Thank you
0
votes
3answers
951 views

How to efficiently store IP addresses? [closed]

Background I have a requirement where I need to remove a few nodes in a network based upon a command given by the user. To keep the nodes from transmitting or receiving data I thought of changing its ...
0
votes
5answers
864 views

New to Programming/objective c

I've recently started to work on some iPhone apps, starting from a base where I had essentially no programming experience (I studied Maths & had very few programming modules) I worked my way ...
0
votes
3answers
528 views

Implementing a priority queue with a circular array

[If this fits more to stackoverflow then transfer it there please.] Hi, I'm trying to implement a priority queue in C. The easiest way I found to do it is with a circular array (rather than using a ...