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
284 views

How to access an encrypted INI file from C on an embedded system with little RAM

I want to encrypt an INI file using a Delphi program on a Windows PC. Then I need to decrypt & access it in C on an embedded system with little RAM. I will do that once & fetch all info; I ...
8
votes
4answers
2k views

Is it important to know C/C++ for Android development?

Is it possible to use only Java (without C++ /NDK) for building good, fast, beautiful Android apps (including 3D development)? When I look for Android developer position requirements (vacancies), I ...
1
vote
1answer
55 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 ...
8
votes
4answers
2k views

Is there any difference between return n and exit(n) in C?

Is there any difference between return n (in the main function) and exit(n) in C? Is it defined by C or POSIX standards or it depends on OS or compiler?
6
votes
3answers
232 views

Approach for developing software that will need to be ported to multiple mobile platforms in the future

I am currently doing the preliminary design for a new product my company will be pushing out soon. We will start on Android, but then we will need to quickly develop the IPhone, IPad.... and then the ...
3
votes
1answer
2k views

Optimal buffer size for fread/fwrite [closed]

What buffer size should I choose for read/write files via POSIX fread/fwrite functions?
7
votes
2answers
342 views

Why error codes are negated?

Very often I see in C code negation of returned error codes, e.g. return -EINVAL instead of return EINVAL. Why used negation?
31
votes
6answers
4k views

Why are there no package management systems for C and C++? [closed]

There are some programming languages for which exist their own package management systems: CTAN for TeX CPAN for Perl Pip & Eggs for Python Maven for Java cabal for Haskell Gems for Ruby Is ...
2
votes
1answer
257 views

Effective handling of variables in non-object oriented programming

What is the best method to use and share variables between functions in non object-oriented program languages? Let's say that I use 10 parameters from DB, ID and 9 other values linked to it. I need ...
1
vote
3answers
617 views

good literature for teaching object oriented thinking in C [closed]

Quite often C is the primary platform for the development. And when things are large scale, I have seen partitioning of the system as different objects is quite a natural thing. Some or many of the ...
4
votes
1answer
703 views

Best Creational Pattern for loggers in a multi-threaded system?

This is a follow up question on my past questions : Concurrency pattern of logger in multithreaded application As suggested by others, I am putting this question separately. As the learning from ...
1
vote
6answers
3k views

Serializing Data Structures in C [closed]

I've recently read three separate books on algorithms and data structures, tcp/ip socket programming, and programming with memory. The book about memory briefly discussed the topic of serializing data ...
1
vote
2answers
407 views

GPLv2 - Multiple AI chess engines to bypass GPL

I have gone through a number of GPL-related questions, the most recent being this one: http://stackoverflow.com/questions/3248823/legal-question-about-the-gpl-license-net-dlls/3249001#3249001 I'm ...
7
votes
2answers
883 views

Questions about linking libraries in C

I am learning C (still very much a beginner) on Linux using the GCC compiler. I have noticed that some libraries, such as the library used with the math.h header, need to be linked in manually when ...
2
votes
3answers
2k views

Functions returning pointers

C++ noob here. I have a very basic question about a construct I found in the C++ book I am reading. // class declaration class CStr { char sData[256]; public: char* get(void); }; // ...
7
votes
5answers
6k views

What should and what shouldn't be in a header file? [closed]

What things should absolutely never be included in a header file? If for example I'm working with a documented industry standard format that has a lot of constants, is it a good practice to define ...
2
votes
1answer
168 views

Setting source IP with posix sockets

Is it possible for an application to request a socket (tcp) and have it set the source address without using raw sockets? (the addresses would be bound to the interfaces. [no spoofing]). This would be ...
1
vote
1answer
117 views

Kernel module implementation estimate [closed]

I have a very abstract question about a kernel module writing estimate. How much dev-hours/months may required to write or, especially, port an existant kernel driver for a new PCI HBA from one ...
1
vote
2answers
231 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 ...
3
votes
5answers
349 views

Does comparison operand order affect speed?

I notice that someone in my organization programs comparisons like: if (100 == myVariable) rather than: if (myVariable == 100) He claims the former is quicker in languages like C++. I can't ...
3
votes
3answers
477 views

What are the options for setting up a UNIX environment to learn C using Kernighan and Richie's The C Programming Language?

I'm a novice programmer and have been experimenting with Javascript, jQuery and PHP but felt I wasn't getting a real depth of understanding of what I was doing. So, after reading Joel Spolsky's ...
0
votes
1answer
124 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 ...
-2
votes
3answers
287 views

What is some key aspect of C/C++ I need to know? [closed]

I had some C background back in the university, however, I have been programming in java for 2 years and most of the C stuff were left behind. Now I need to prepare for a test about C/C++, I doubt ...
13
votes
5answers
18k views

How to write a very basic compiler

Advanced compilers like gcc compile codes into machine readable files according to the language in which the code has been written (e.g. C, C++, etc). In fact, they interpret the meaning of each codes ...
4
votes
5answers
564 views

Good Practices for development team in large projects

Since I started learning C a few years ago, I have never been a part of a team that worked on a project. I am very interested to know what are the best practices for writing large projects in C. One ...
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 ...
1
vote
2answers
394 views

Python as a first language? [closed]

I have just started working in Information Security World. I want to learn the Python language for creating my own automated tool for Fuzzing, SQL-Injection etc. My question is I don't know much ...
-1
votes
1answer
429 views

mobile app development noob [closed]

I know c, most of c++, a little assembly, win32 console, etc I'm looking for free, cross-platform, c / c++, emulator, etc. I'm a beginner to the mobile app world, so I'm lost. Some that pop to mind ...
5
votes
8answers
608 views

Learning OO for a C Programmer [closed]

I've been programming professionally in C, and only C, for around 10 years in a variety of roles. As would be normal to expect, I understand the idioms of the language fairly well and beyond that ...
3
votes
1answer
180 views

Parallel Threading in Multi-Language Software?

I'm developing a software that contain many modules/Daemon running in parallel manner, what i'm looking for is how to implement that, i cannot use Thread because some of those modules/Daemon are ...
62
votes
12answers
16k views

How can I convince my boss that ANSI C is inadequate for our new project? [closed]

A few months ago, we started developing an app to control an in-house developed test equipment and record a set of measurements. It should have a simple UI, and would likely require threads due to the ...
0
votes
3answers
569 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, ...
2
votes
2answers
539 views

Shared FIFO file descriptor

is ok to open fifo with one FD and share it with multiple threads? or is it better to have multiple fds opened for the same fifo and share these fds with the threads? BTW, I'll be doing write and ...
1
vote
5answers
618 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
401 views

How is this number calculated?

I have numbers; A == 0x20000000 B == 18 C == (B/10) D == 0x20000004 == (A + C) A and D are in hex, but I'm not sure what the assumed numeric bases of the others are (although I'd assume base 10 ...
6
votes
4answers
973 views

What's so bad about pointers in C++?

To continue the discussion in Why are pointers not recommended when coding with C++ Suppose you have a class that encapsulates objects which need some initialisation to be valid - like a network ...
5
votes
8answers
783 views

Grading an algorithm: Readability vs. Compactness

Consider the following exam / interview question: Implement the strcpy() function in C: void strcpy(char *destination, char *source); The strcpy function copies the C string pointed by source into ...
4
votes
1answer
469 views

Test-Driven Development with plain C: manage multiple modules

I am new to test-driven development, but I'm loving it. There is, however, a main problem that prevents me from using it effectively. I work for embedded medical applications, plain C, with safety ...
8
votes
6answers
1k views

Is it OK to mix C and C++ in an interview?

If I am asked in an interview to write down some code, should I completely stick with C++ or is it acceptable to "mix" the two to write easy code as it comes to my mind? I'll explain it: if I'm asked ...
0
votes
5answers
896 views

Learning basic algorithms - better C or C++? [closed]

I'm studying fundamental algorithms (quicksort, mergesort, binary trees, etc..) and I'm going to re-code every algorithm by scratch to learn how they work. Should I code them in C or C++? I think with ...
3
votes
2answers
493 views

Linux OpenGL programming, should I use GLX or any other?

I'm new to OpenGL and found that there are a lot of libraries to do that in C, and I also found that glx is most friendly with Linux X Server, I just want to do basic stuff, and I cannot find any ...
2
votes
2answers
456 views

Is there any advantage to learning C first?

I've got a little bit of history with programming, having gotten my start with Visual Basic. I let it slide as a hobby from a little after VB6 up until just a year or so ago when I got on the iPhone ...
7
votes
4answers
791 views

Semi-intelligent “diff” utility

Part of the QA steps required for a project I am tangentially involved with require the person who is responsible to integrate new version of source file to first calculate how many lines have been ...
15
votes
8answers
1k views

Reverse engineering: what is it really good for? [closed]

I have some innocent/beginner questions: What is reverse engineering good for? As a programmer, should I learn the art of reverse engineering? What are the benefits to a programmer who is ...
1
vote
1answer
138 views

Advice sought: highly technical app idea - do I employ someone or do it myself? [closed]

I'm a TV producer in London but also an enthusiastic amateur coder and web designer. I started with VB6 and then moved onto C/PHP/Obj-C. I've got a couple apps in the app store, I mess around a lot ...
0
votes
3answers
2k 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 ...
1
vote
1answer
239 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 ...
13
votes
10answers
2k views

Preferring Python over C for Algorithmic Programming

I've been studying a bit of algorithms and have been looking at sites like SPOJ.pl TopCoder etc. I've seen that programmers prefer C or C++ usually for most algorithmic programming contests. Now ...
5
votes
1answer
557 views

Are there any FOSS operating systems available that conform to NASA's JPL coding standards? [closed]

I, like many others, have been completely enamored with the recent successful landing of Mar's Curiosity rover. After reading a couple of articles, and following a few links, I've found a couple C ...
-2
votes
3answers
530 views

Associativity in C

int i = 2*5/2; int j = 2*(5/2); printf("%d\n,%d\n",i,j); Variable Associativity: when I run this program, the first statement gives me i = 4; Shouldn't it give me 2, because according to BODMAS ...