Most active questions

Best practices
8 votes
27 replies
2k views

I'm moving from C to C++ and I'm trying to avoid using C practices in C++. It is said that raw pointers are a C feature, and that in C++ I should use smart pointers instead, yet every example I have ...
noname noname's user avatar
11 votes
5 answers
1k views

Consider the set {A,B,C} and an operator op defined by the following table A op A = A A op B = A A op C = A B op A = A B op B = B B op C = C C op A = A C op B = C C op C = B I would like to encode A,...
abcdefg's user avatar
  • 4,915
12 votes
4 answers
1k views

Both amd64 and arm64 architecture processors have an overflow flag. However, in C, the most common method to detect whether an operation causes overflow/underflow is to make functions like these: int ...
Daniil Zuev's user avatar
Advice
2 votes
11 replies
388 views

I watched a few tutorials on YouTube. They said to assume a 32-bit architecture and then said "a single CPU cycle can only access a word (equals the CPU's native size i.e 4 bytes) at a time from ...
Random Guy's user avatar
Advice
1 vote
17 replies
195 views

The following code compiles on std >= C++20 but fails to compile on std < C++20. This holds for msvc, gcc and clang. #include <cstdio> int main() { struct byte { unsigned ...
Puzomor Croatia's user avatar
Best practices
2 votes
5 replies
151 views

Suppose I have a C-style matrix of elements typedef struct _RAW_DATA{ int a; int b; }RAW_DATA; inside a templated class, that defines the size of the matrix: template<size_t TDim> ...
user2281752's user avatar
2 votes
2 answers
145 views

Is there a way to prevent implicit conversions happening in concepts? For example, this example compiles with GCC and clang when I actually want it to give an error that the char constructor is ...
Hello Worlder's user avatar
3 votes
2 answers
164 views

I've seem to run into something I can't really explain. I'm testing out passing a struct (typedef with an alias) by value into a function and printing out the addresses of each. I do realize that ...
Maryann's user avatar
  • 79
0 votes
3 answers
140 views

I try with some regex to obtain only the URL of all the videos about $pattern but my $regex not work (in this case $pattern = "Greta"): $data = '<p><a href="https://www.youtube....
Yamile's user avatar
  • 55
1 vote
2 answers
363 views

As C++26 standard's timeline is getting near, I want to know: What is(are) the reason for no built in support of networking by the C++ standard. That is, what exactly are the problems that lead to ...
Richard's user avatar
  • 47.7k
4 votes
4 answers
123 views

I'm trying to figure out how to change values in a column (Age), based on the values of two separate columns (Species and Length). I have a dataset of fish lengths, with all of them designated either &...
Ray's user avatar
  • 85
Advice
2 votes
7 replies
119 views

Let's consider this example code: #include <stdint.h> #include <stdio.h> struct image { int width, height; uint8_t *pixmap; }; static void iprint(const struct image *img) { ...
Costantino Grana's user avatar
Advice
0 votes
5 replies
128 views

I am reviewing an application and it has numerous functions with the following function declaration. I've never seen this type of function declaration with the "local" identifier before the ...
Skypilot65's user avatar
0 votes
4 answers
188 views

When one thread is blocked in a synchronized method of an object, does another thread have access to that object through the same or another synchronized method? Actually, will my thread be blocked if ...
user30106584's user avatar
Advice
0 votes
7 replies
127 views

Is there a shorter way to write the following in php? $bar = isset($foo['bar']) && $foo['bar']; or $verylongname = isset($_POST['verylongname']) && $_POST['verylongname']; I'm using ...
2Bias's user avatar
  • 61

15 30 50 per page
1
2 3 4 5
62