Is there a decent wait function in C++?

you can require the user to hit enter before closing the program… something like this works. The cin reads in user input, and the .ignore() function of cin tells the program to just ignore the input. The program will continue once the user hits enter.

make: g++: Command not found

You need to install the development tools from GNU. I assume you’re on windows, in which case you have two options: cygwin and mingw. The former includes g++ out of the box. I’m less familiar with mingw, but the C++ Standard library appears to, also, be available. See these installation instructions, I’d recommend starting from step 1, if at all possible.

What is uintptr_t data type

uintptr_t is an unsigned integer type that is capable of storing a data pointer. Which typically means that it’s the same size as a pointer. It is optionally defined in C++11 and later standards. A common reason to want an integer type that can hold an architecture’s pointer type is to perform integer-specific operations on a … Read more

TranslateName() function doesn’t work on win10

my working computer is win10, and I am using vs2015, now I’ve met a weird issue. I can get the NameSamCompatible name by the following source code: the Username would be “PROD\wwu2”, but I would get failed if I run: then I get the error code by GetLastError(); it is 1317(user doesn’t exist). but the … Read more

When and why do I need to use cin.ignore() in C++?

Ignore is exactly what the name implies. It doesn’t “throw away” something you don’t need instead, it ignores the amount of characters you specify when you call it, up to the char you specify as a breakpoint. It works with both input and output buffers. Essentially, for std::cin statements you use ignore before you do a getline call, because … Read more

“items list” or “item list”

In English, a “collection of stamps” is a “stamp collection”. (At best, “stamps collection” would be understood). In programming, I’m not entirely sure why, but we1 do sometimes use the form “StampsCollection”. It may be because we try to use more precise and logical lingo than traditional English provides; we start with the name “Item”, pluralise it to “Items”, then be precise … Read more

C/C++ JSON parser

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 5 years ago.Improve this question We have requirement of C/C++ Parser in my application. What application does is it calls rest webservice and takes output from service. If output is JSON … Read more

error: lvalue required as unary & operand

The address-operator & requires a variable to take the address from. The result of your cast (long)u32_Time is a temporary that does not necessarily reside in memory and therefore has no address that could be taken. So if that piece of code ever compiled somewhere it was a nonstandard compiler extension. The standard, §5.3.1,3 demands: The result of the … Read more