I am reading K&R book for c language and in section 2.10 they give the following example: /*bitcount: count 1 bits in x*/ int bitcount(unsigned x) { in
I am trying to register my bluetooth SDP service in C++ linux as shown here: Example 4-9. Describing a service Where or how can I check exactly that the servic
Q 1. Problem 5 (evenly divisible) I tried the brute force method but it took time, so I referred few sites and found this code: #include<stdio.h> int gcd
Is it possible in Java to do a sort of #ifdef thing, like in C/C++? Example: class Test { public static final boolean ANDROID = false; public Test()
Greetings Overflowers, I know in C we can define a struct inline with the variable declaration so that the struct type is specific to this variable. This is in
This is my logic. I wrote function for counting the no. of occurrences of each letter in a string. But this doesn't work correctly. Correct me. void countChar(c
This is my logic. I wrote function for counting the no. of occurrences of each letter in a string. But this doesn't work correctly. Correct me. void countChar(c
In C/C++ when I want to find sum of two chars - I get result in int. For example: #include <stdio.h> int main(){ char a = 'a', b = 'b'; printf("%d
I know the integer format would be different between big-endian machine and little-endian machine, is it the same for float point format (IEEE 754)?
Does C (or any other low-level language, for that matter) even have source, or is the compiler the part that "does all the work", including parsing? If so, coul
I often hear that when compiling C and C++ programs I should "always enable compiler warnings". Why is this necessary? How do I do that? Sometimes I also hear
Seeing Alexandre C's reply in the other topic, I'm curious to know that if there is any performance difference with the built-in types: char vs short vs int vs
The following C program compiles and spits out a a directory listing of "/Users/home/tempdir" directory. #include <stdio.h> #include <unistd.h> i
I configure the ICP1 to get the pulses but when it happens, the avr is resetting, sometimes when the uart iterrput occurs it also reset. I don't know where I'm
I've been reading "The C Programming Language" and I got to this part of inputs and outputs. I've read other threads saying that the console doesn't recognize e
Is there a way to detect if the mouse has been moved ANYWHERE on the X Server or a keyboard event occured? I need to react on the user doing anything with the X
I'm looking for a way to easily embed any external binary data in a C/C++ application compiled by GCC. A good example of what I'd like to do is handling shader
I have a TCP connection. Server just reads data from the client. Now, if the connection is lost, the client will get an error while writing the data to the pipe
I'm running this code from the command prompt. The output of this code is 0 but I was expecting it to output 1. Can you explain how this code is actually compi
The "\b" didn't work on my Mac. So I tried to find the reason. I think that cause of this problem may be the version of C. Or device could be. If you know it, c