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

learn more… | top users | synonyms

-1
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 ...
-1
votes
2answers
162 views

Assigning strings to pointer in C Language

I am a new learner of C language, my question is about pointers. As far i learned and searched pointers can only store addresses of other variables, but cannot store the actual values(like integers or ...
-1
votes
2answers
3k 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
132 views

Reading assembly useful for insights when writing C/C++? [closed]

While in most cases its not necessarily, recently I have taken to reading the generated assembly of my C code every so often, when I'm curious as to the kinds of optimizations my compiler is making. ...
-1
votes
2answers
461 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
581 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
221 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
99 views

dynamic memory allocation in c language [on hold]

i'm using dynamic memory allocation in c programming.. supposing i've program like this void main() { int *C; int sum; ----------- statements ----------- test(C,sum); } void test() { --------- ...
-1
votes
1answer
213 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
114 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
118 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 ...
-1
votes
1answer
2k views

Streaming data from a microcontroller to a server? [closed]

Edit *We have a heart monitor hooked up to to an msp430 with a roving networks wifi module. I would like to connect send some type of a datastream to a webserver so that someone could watch it ...
-1
votes
0answers
40 views

In C language fscanf reads last number twice [migrated]

I have written this code to read from an input file and display the numbers: #include<stdio.h> int main() { int i; FILE * f; f=fopen("inputA.txt","r"); while (!feof(f)){ fscanf(f, "%i", ...
-1
votes
0answers
54 views

Problems with printf() on AVR in C with floating-point [migrated]

I've been getting back into C, and I've been working on an 'academic' exercise to sharpen some old skills again. My project revolves around the rather simple process of generating sines. I started out ...
-1
votes
0answers
92 views

When learning programming, is it better to start from the oldest language? [closed]

Many years ago, we were taught how to operate and develop simple programs using Turbo Pascal. Now, I would like to learn more about programming languages. I know that I'm starting off from a vague ...
-2
votes
1answer
126 views

Ambiguous If-else nested block in C without braces [closed]

Consider the following code in C: if(34) if(0) printf("Stat1"); else printf("Stat2"); Here,the first if condition is true,while the second if condition is ...
-2
votes
4answers
224 views

Benefits of porting C library to C++ [closed]

Say we take any C library such as libpng or libvorbis and convert it so that it compiles as C++ (only the minimum changes to make it compile as C++ code). Can the compiler do extra optimizations when ...
-2
votes
3answers
627 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 ...
-2
votes
1answer
285 views

Could ChromiumOS be re-written in Go from the ground up? [closed]

As Go seems able to performance match C and with Google obviously biased towards Go, I feel that it would be great way for Go to gain more traction. The way ChromiumOS/Chrome has jumped from an ...
-2
votes
2answers
128 views

Returning void from a function specified to return int [closed]

int count_to_ten ( int count ) { /* we only keep counting if we have a value less than ten*/ if ( count < 10 ) { printf("%d",count); count_to_ten( count + 1 ); } return; } int ...
-2
votes
1answer
112 views

Uniqueness of for loop [closed]

How does the for loop function is implemented so that it can accept ; as parameter separator rather than , which is trivial in normal functions.
-2
votes
2answers
438 views

Why we still need C in terms of development for high level programming modules? [duplicate]

Possible Duplicate: I don't know C. And why should I learn it? I was kind of awkward in coding with C, though I am somewhat familiar with it. I like Java and C#. The reason I like to ...
-2
votes
3answers
310 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 ...
-2
votes
2answers
404 views

Shouldn't storage classes be taught early in a C class or book? [closed]

Shouldn't storage classes be taught early in a C class or book? I notice that a lot of books, even some of the better ones, covert it toward and end of the book and some books just add it as an ...
-2
votes
1answer
113 views

How can we make a certain thing inbuilt in c language with our own header file?

I want to make the basic trigonometric functions in maths inbuilt functions using my own header file . so as the users can do trigonometry in c language compilers.
-2
votes
1answer
170 views

What are steps in making an operating system in C ? [duplicate]

I am trying to make an my own OS. This is for educational purpose only, so that I get to understand the internals as well as get a good idea of low level programming. I have some prior application ...
-2
votes
4answers
899 views

C simple arrays and pointers question

So here's the confusion, let's say I declare an array of characters char name[3] = "Sam"; and then I declare another array but this time using pointers char * name = "Sam"; What's the ...
-2
votes
1answer
1k views

Is C a pre-requisite in order to learn C++ effectively? [duplicate]

I only have programming experience with high-level languages, as well as with DBMS. Now, I would like to get into C and/or C++. My question is: Is the C language a pre-requisite in order to learn C++ ...
-2
votes
1answer
244 views

C Minishell Command Expansion Printing Gibberish

I'm writing a unix minishell in C, and am at the point where I'm adding command expansion. What I mean by this is that I can nest commands in other commands, for example: $> echo hello $(echo ...
-2
votes
0answers
63 views

Why goto statement is not considered as loop in C language [duplicate]

Printing the numbers 1 to 5 using a for loop is possible, and using goto statement also is possible, but for is considered a loop and goto is not considered as loop. Why is this?
-3
votes
4answers
292 views

What are good strategies in C for dealing with pointer errors of this type?

In C, I often come across errors with code like this prio_queue->head[index] = newEntry; Yields a " "Cannot assign Entry** to Entry* " How do you prevent/debug errors of this type, in general? ...
-3
votes
1answer
110 views

Implementing keyword “const” [closed]

A constant pointer is a pointer which points to a fixed memory location throughout.The question is how do you ensure that this behavior is ensured without using the keyword constant while declaring ...
-3
votes
3answers
384 views

More Accurate Random in C [closed]

I have 3 IPs and every IP has a weight, I want to return the IP's according to its weights using the random function. For example if we have 3 IP's X with weight 3 Y with weight 3 and Z with weight ...
-3
votes
2answers
663 views

I'm having trouble understanding these exercises wording [closed]

Exercise 1-20. Write a program detab that replaces tabs in the input with the proper number of blanks to space to the next tab stop. Assume a fixed set of tab stops, say every n columns. Should n be a ...
-3
votes
1answer
88 views

Illustrate Meaning of : gcc -g programName.c

To debug a C program using gdb effectively it is required to compile it first using the command: gcc -g programName.c otherwise on using simply gcc programName.c and running we are unable to ...
-3
votes
1answer
302 views

Should i shift from Testing to Development? [closed]

i have 1.2 yrs of experience in Testing in big MNC company, I have good Programming knowledge in Java (Core,Servlets). I have completed ISTQB certification(Testing) and trying for HP QTP ...
-3
votes
0answers
47 views

adding manually written headers in C language [migrated]

I'm writing a code for a radio, which contains many child functions and header functions. I've created two headers "simulation_params.h" in which the simulation parameters can be changed, and ...
-3
votes
0answers
19 views

C code link edit error in Visual studio 2003 [migrated]

I have installed Visual Studio 2003 in my Windows 7 system and started compiling the C code by using the NMAKE functionality. I have compiled the code with out any issues, but during the linking ...
-3
votes
0answers
39 views

C Programming reading file [migrated]

I am trying to write a very simple code to read a file. However in that file I have M_PI/2, which is pi/2. When my code reads that file it spits M_PI/2 as 0.000. How do I make my program to make it ...
-4
votes
2answers
884 views

Why aren't there modern C IDEs? [closed]

Why weren't the features present in modern IDEs for Java & C# (Intellij IDEA, Visual Studio, eclipse) developed in (earlier) IDEs for C language? I mean I don't know any IDE which has modern ...
-4
votes
1answer
129 views

Calculate Pi to N number of places [closed]

I am trying to work out how to calculate Pi to N decimal places, I think the default DP's for a float/double is 5 and then you have setprecision() however these are obviously inadequate, I need ...
-4
votes
0answers
18 views

Csharp multiple button presses [on hold]

I have a button in a program and I want it to where when I click the button it goes to page 2 but if I click it again it goes to page 3 kinda like a book.
-5
votes
2answers
595 views

what will be the Output of the following code written in “ C”?

#include<stdio.h> void main() { char ***p="hello"; printf("%c",++*p++); } I haven't understand the concept of (*) indirection uses here three times. When i compiled this program then the ...
-5
votes
1answer
273 views

C quiz, puzzles obfuscated C [closed]

I believe that I am a good C programmer. I can solve beginner level Question in google's code jam. I did solve all of the programming examples in KN kings: C programming. Given a problem I can express ...
-7
votes
2answers
4k views

What would be the prototype of printf?

look at these calls closely: printf("hello, world\n"); printf("%d", 2); printf("%d%g\n", 2, 2.3); we see that printf can accept any type and any number of args. however we know that functions in c ...