c


c++ - What is the difference between #include <filename> and #include "filename"?

In practice, the difference is in the location where the preprocessor searches for the included file. For #include <filename> the preprocessor searches in an implementation dependent manner, normall... Read More


How can I create a Makefile for C projects with SRC, OBJ, and BIN subdirectories?

First, your $(OBJECTS) rule is problematic, because: it's kind of indiscriminate, making all sources prerequisites of every object, it often uses the wrong source (as you discovered with file1.o an... Read More


c++ - Memory alignment in C-structs

At least on most machines, a type is only ever aligned to a boundary as large as the type itself [Edit: you can't really demand any "more" alignment than that, because you have to be able to create a... Read More


c++ - Bitcoin value as int64_t or as double

I want to do program that doing some calculations with bitcoin values. I know bitcoin have 8 digits after decimal point (please correct me). There is no decimal in bitcoin at code level. There is n... Read More


c - Can't understand this way to calculate the square of a number

Obviously a hack... but a way of squaring a number without using the * operator (this was a coding contest requirement). (&a)[n] is equivalent to a pointer to int at location (a + sizeof(a[n])*n)... Read More


objective c - How dangerous is it to compare floating point values?

First of all, floating point values are not "random" in their behavior. Exact comparison can and does make sense in plenty of real-world usages. But if you're going to use floating point you need to... Read More


c - How do I use valgrind to find memory leaks?

How to Run Valgrind Not to insult the OP, but for those who come to this question and are still new to Linux— you might have to install Valgrind on your system. sudo apt install valgrind # Ubuntu, D... Read More


c++ - Why does modulus division (%) only work with integers?

Because the normal mathematical notion of "remainder" is only applicable to integer division. i.e. division that is required to generate integer quotient. In order to extend the concept of "remainder... Read More


c++ - Is there a reason why not to use link-time optimization (LTO)?

I assume that by "production software" you mean software that you ship to the customers / goes into production. The answers at Why not always use compiler optimization? (kindly pointed out by Mankars... Read More


c - What does the brk() system call do?

In the diagram you posted, the "break"—the address manipulated by brk and sbrk—is the dotted line at the top of the heap. The documentation you've read describes this as the end of the "data segment... Read More