VS __forceinline in cpp [closed] - c++

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
Can I use __forceinline in .cpp file wtih VS 2013?
From this manual's examples it seems to be possible
http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx . But I want to be sure.

Yes you can, and it's actually enforced really well (unlike gcc/clang etc, where __attribute__((always_inline)) is unfortunatly still optional for the compiler, depending on multiple other compiler flag settings).
The keyword works in all versions of Visual Studio.

I read the link you gave. The page does explicitly say it is for VS 2013. Try it out and step through the code with the debugger to be certain.

Related

Const Auto/Identifier Errors [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I having trouble understanding why it won't identify this.
Any help is greatly appreciated.
Errors
Rest of the Code
This is C++17 syntax. As this standard is not yet the default option for most compilers you have to tell the compiler that you are using it via the -std=c++17 switch.
PS: you didn't say which compiler you are using, so maybe it will not support that switch or not even support C++17 at all.

why does scanf_s cause Compiler Error on OnlineJudge? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I use scanf_s to input data.
It causes compiler error on OnlineJudge, while scanf can pass the test.
I've included cstdio.
Is scanf_s included in other STLs?
As Govind Parmar stated in his comment, scanf_s is a Microsoft extension. OnlineJudge uses GNU C++ compilers, and thus, using Microsoft extensions will not work.
Helpful note: if you'd like to test your code on a standard compiler before submitting, there are several available online, such as ideone.

C++ Change output executable name in code [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I have a question... Is it possible to somehow change output executable name in code? I mean something like
#ifdef COMPILE_DEBUG
...Name="Client_debug.exe"
#endif
Thanks in advance.
No. The C++ language doesn't provide any portable mechanism to do that.
Once you start talking about particular platforms, you change the executable name in the .vcxproj file (or whatever build system you are using) - which ends up changing options passed to the linker.
Some compilers have platform specific pragmas to pass options to the linker - they might be able to do this. But at that point you have to edit your .vcxproj file to pass suitable #defines in - why not just change the output file?

ServerSocket.h and ServerException.h not found C++ [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
So I was writing some socket programming in C++. I'm new to the concept in general. I was following this tutorial, but when I go to compile it, my compiler g++ says the header files are not found. I'm on linux (Netrunner 14 Frontier), so I updated all my headers but I still get the error. Is there any way to fix this? If not, any recommendations for how to do socket programming in linux?
These files are not part of the Linux system. If you look at the bottom of the page, it says:
The following files make up our example:
Beneath that line is a list of links to other files / dependencies, including those ones.

size_t redefined in calcstar [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I need to use calcstar that is math expression evaluator...
I just simply include calcstar.h file and it include everything else
#include "calcstar.h"
but when I try to compile my code i get this error:
size_t redefined
This error appears inside calcstar's own files...but the point is that this library is published online so I assume it is tested and doesn't have a bug...
What is the problem? Am I doing something wrong?
I really need a mathematical expression evaluator for my project.
CalcStar, assuming you got it from here, was apparently developed using Visual Studio 2008 (the download file name is CalcStarApp_VS2008_03202014.zip.).
One of the quirks of Visual Studio is that it allows redefinition of typedefs. Other compilers (like the one you appear to be using) do not.
You'll need to modify code appropriately.