Quantcast
Channel: User Peter - Reinstate Monica - Stack Overflow
Browsing index pages (358 articles)

Comment by Peter - Reinstate Monica on Overloading function template with...

Not sure what happens if and when this question is closed...

View Article


Answer by Peter - Reinstate Monica for Is a directory in a file system just a...

Directories typically have a material presence on disk. In early Unix, which probably introduced the clearest concept of file systems with a tree-shaped directory structure, directories were actually...

View Article


Comment by Peter - Reinstate Monica on C: How to fold a constant before it is...

I wonder whether there may be constexpr possibilities in C++. std::to_string() does not appear to be.

View Article

Answer by Peter - Reinstate Monica for What happens if i mix c with c++ in a...

It is simple: Everything that you present to a C++ compiler must be valid C++.Not coincidentally though, most C — including its standard library (for things like printf) — is actually valid C++ as well...

View Article

Comment by Peter - Reinstate Monica on Parts of the stack frame in Visual...

Not sure about the close reason -- I posted it because it's clearly useful as a reference for future users. I also think it's not better suited for, say, superuser or such. Stackoverflow is the proper...

View Article


Comment by Peter - Reinstate Monica on What are the differences between...

@dancarter Well, VS Code integrates everything except a compiler and debugger ;-). Which leaves ... an editor. As advertised. To make this DE an IDE you have to add the "I" yourself, so to speak...

View Article

Comment by Peter - Reinstate Monica on Parts of the stack frame in Visual...

@TylerH Especially the fact that there is no (obvious) warning about this. Btw., at least for a sample size of 1, killing the devenv process during a build does not leave the compiler processes behind.

View Article

Answer by Peter - Reinstate Monica for What happens if i mix c with c++ in a...

It is simple: Everything that you present to a C++ compiler must be valid C++.Not coincidentally though, most C — including its standard library (for things like printf) — is actually valid C++ as well...

View Article


Comment by Peter - Reinstate Monica on How can I avoid "for" loops with an...

@CodyGray Seriously: Coders should be paid by lines deleted -- that would be a better metric than most and lead to better software, in most cases.

View Article


Comment by Peter - Reinstate Monica on Why should I not #include ?

IIUC, gcc uses a precompiled version; as an effect, it may be faster than including only the needed single headers (although those could be precompiled as well).

View Article

Comment by Peter - Reinstate Monica on Is repository size really a Git...

Often, there is a central repository on a company server or some cloud git provider. Often, it is tolerable when these repos become large -- the main pain is that every local "working clone" is that...

View Article

Comment by Peter - Reinstate Monica on When should I use std::thread::detach?

@Andrew You are being sarcastic, right?

View Article

Comment by Peter - Reinstate Monica on Does p-- point to b in this code, or...

There is no problem with using namespace std in a short demo program like this. It's the first thing I do because it makes the program more readable, which is paramount here.

View Article


Comment by Peter - Reinstate Monica on What do fgetc and fputc have to do...

It should not be too much effort to write a toy toy program which does something trivial (but observable) with the data each way so that you get a rough idea. Presumably with optimization enabled to...

View Article

Answer by Peter - Reinstate Monica for Accessing static properties of a...

The straight-forward way is apparently a grey area in the language specification:struct Example{ static int example() { return 0; }};typedef Example* PointerType;int main(){ PointerType p = nullptr; //...

View Article


Answer by Peter - Reinstate Monica for How define an array of function...

There are a number of correct answers here; but they fail to mention the beautiful simplicity of the C grammar which, once understood, helps solving question like this one.1. Declarations syntactically...

View Article

Answer by Peter - Reinstate Monica for How change every struct in an array of...

As dbush said: The more typical case, and probably what you (don't know you) want is an array of objects, not only pointers to objects:#include <stdio.h>#include <stdlib.h>struct Person {...

View Article


Answer by Peter - Reinstate Monica for error: use of deleted function -...

The simplest and most adequate solution here is to use a member pointer instead of a reference. The two are very similar — the main difference is that pointers can change what they refer to, which is...

View Article

Answer by Peter - Reinstate Monica for Why does C++ introduce a "::" instead...

I hope this question will be closed soon (not because it is bad but because it has been asked and answered over at softwareenineering (where it doesn't belong either, by the way: It should be in...

View Article

Answer by Peter - Reinstate Monica for Why does x crash when I give it a...

Nothing is technically wrong with the code as presented (except the missing headers and using namespace std, as Alan correctly observed).The cast should not change anything; you are right that a string...

View Article
Browsing index pages (358 articles)


Latest Images