[Solved] Is there a way to specify C++ compatibility level for Microsoft C++ compiler?

As of Visual C++ 2015 Update 3, it is now possible to specify a language version for language behavior (apparently it doesn’t affect just conformance checking): https://blogs.msdn.microsoft.com/vcblog/2016/06/07/standards-version-switches-in-the-compiler/ Unfortunately the only options are “C++14” (not exact, it includes post-C++14 features which had previously shipped) and “C++ Latest” (C++14 plus partial implementation of C++17 and proposals, but … Read more

[Solved] Phone book project error.There are no errors found in compiler but it exits when it runs have been trying for very long [closed]

Your code does not make any sense. There are many problems with what you have written I’m not going to go through them all, but the most glaring is if (option == 1) { void addcontact(info contactlist[]); } This is not how a function is called. Instead, it should look like if (option == 1) … Read more

[Solved] Impossible declare string type in C++

The hint is in the warnings: the #include <string> is ignored because it’s apparently after the include of the precompiled header file. Make sure the precompiled header is included first. Background: If the corresponding project setting is enabled, the Visual C++ Compiler will, in a pre-preprocesser step, replace the line #include “stdafx.h” (this is the … Read more

[Solved] Does using the iterator member function “empty()” only work on certain vector types?

empty() is not “an iterator member function”. You are not calling empty() on the iterator – you are dereferencing the iterator, and calling empty() on the vector element that the iterator refers to. It might be clearer if you replace iter->empty() with an equivalent form (*iter).empty() In still other words, auto iter = vec.begin(); iter->empty(); … Read more

[Solved] Should C compilers immediately free “further unused” memories? [closed]

I don’t know where you get your analysis from. Most parts like the abstract syntax tree is kept because it is used in all different passes. It might be that some, especially simple compilers don’t free stuff because it’s not considered necessary for a C compiler. It’s a one shot compilation unit operation and than … Read more

[Solved] randomize numbers without any std- function

I found similar question on stackoverflow : How do I generate random numbers without rand() function? I make little modifications for generating between 0-35 and final solution: #include<stdio.h> #include<time.h> int main() { int num = 36; time_t sec; sec=time(NULL); for(;;) { sec=sec%3600; if(num>=sec) { printf(“%ld\n”,sec); break; } sec=sec%num; } return 0; } Here we are … Read more

[Solved] Incorrect output [closed]

Uhm, first of all your title references one error and your question shows another. Both are legitimate so let’s fix both, shall we? The thing is the C4716 error message tells you exactly what the error is: you just have to read it. It says that the function student::standing() claims to return a string but … Read more