I'm working on a 2 pass assembler and have been looking at sample codes online to familiarise myself. I found the following code but there appears to be a probl
I created my version of strlen() function. unsigned int my_strlen(char *p) { unsigned int i = 0; while(*p!='\0') { i++; p++; }
Let's say that I declare a C struct called foo, which has an int field called bar and a char * called baz. How do I use the Cmocka expect_ and check_expected m
When I try to determine end of file with function feof(FILE *), I find it does not work as I expected: an extra read is required even if the stream does end. E.
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