logo
down
shadow

CPP QUESTIONS

What's wrong with these pointer initialization
What's wrong with these pointer initialization
wish help you to fix your issue The initializations are fine. Doing pointer arithmetic on NULL pointers is wrong.Also, cout
TAG : cpp
Date : November 27 2020, 07:01 PM , By : Kovács Tamás
Access Violation Using memcpy or Assignment to an Array in a Struct
Access Violation Using memcpy or Assignment to an Array in a Struct
With these it helps Update 2: , It is illegal to attempt to modify string literals. Your
TAG : cpp
Date : November 27 2020, 07:01 PM , By : user3863788
Wrong operator() overload called
Wrong operator() overload called
Does that help The const member function (the "viewing" function) will only be called if the object is const:
TAG : cpp
Date : November 27 2020, 07:01 PM , By : Charles Bessonnet
Subtractively sweep a solid through another in python (or C++)
Subtractively sweep a solid through another in python (or C++)
I hope this helps . pythonOCC is an interesting option too!
TAG : cpp
Date : November 27 2020, 07:01 PM , By : user3863784
boost ublas: rotate 2d vector
boost ublas: rotate 2d vector
fixed the issue. Will look into that further BLAS == Basic Linear Algebra Subroutines, emphasis on the basic. The BLAS functions are extremely general, they don't have anything nearly as specific as 2D vector rotations. Just do it manually: make your
TAG : cpp
Date : November 27 2020, 07:01 PM , By : tsepomaleka
How can a Windows program temporarily change its time zone?
How can a Windows program temporarily change its time zone?
this will help Use Isolation/Mocking framework - the only one I know of at the moment is Isolator++ which is currently in beta, I'm sure that you can get a copy by asking for one from the good people of Typemock.
TAG : cpp
Date : November 27 2020, 07:01 PM , By : user3863749
small & readable scheme interpreter in C++?
small & readable scheme interpreter in C++?
fixed the issue. Will look into that further Well, there's a veeery tiny lisp by Gary Knott. Not even close to R5RS, but it's small, and comes with a book describing the internals! However, it's C, not C++, and as far as I can remember there's no GC
TAG : cpp
Date : November 27 2020, 07:01 PM , By : user3863734
Cannot change the height of a combo box in the VS Dialog Editor
Cannot change the height of a combo box in the VS Dialog Editor
hop of those help? The height you provide for the combo box specifies the size of the combo box when it is opened. The height of the edit control portion is based on the font. (Or based on your item size if you are owner-draw.)
TAG : cpp
Date : November 27 2020, 07:01 PM , By : Sajjad.Saraji
Access reading error when using class member variable
Access reading error when using class member variable
I hope this helps you . I have a class with private member variables declared in a header file. In my constructor, I pass in some filenames and create other objects using those names. This works fine. When I try to add another member variable, howeve
TAG : cpp
Date : November 27 2020, 07:01 PM , By : afaqce
How to tell if two exe's are the same code-wise?
How to tell if two exe's are the same code-wise?
I think the issue was by ths following , You could use a dissembler to disassemble the executable back into assembly and compare with a normal text diff tool.But even that will not be 100% accurate. The compilation process is not lossless and much in
TAG : cpp
Date : November 27 2020, 07:01 PM , By : user3863432
Modifying an old Windows program not to call exit after a keypress without source access
Modifying an old Windows program not to call exit after a keypress without source access
I wish did fix the issue. If you have an HWND to the window that processes the message, you can intercept its messages, selectively not delivering certain messages to the "real" window procedure.For example:
TAG : cpp
Date : November 26 2020, 07:01 PM , By : user3863419
What is name lookup mechanism?
What is name lookup mechanism?
around this issue Name lookup is the process of identifying what a name means. Name lookup has two purposes Disambiguate parsing of your code Determining what precisely your code means
TAG : cpp
Date : November 26 2020, 07:01 PM , By : ottopaul
What does the C++ compiler error "looks like a function definition, but there is no parameter list;" mean?
What does the C++ compiler error "looks like a function definition, but there is no parameter list;" mean?
seems to work fine , I don't hate you. ♥Functions have parameters, such as:
TAG : cpp
Date : November 26 2020, 07:01 PM , By : faguotan
Why does this crash with access violation to 0xcccccc...?
Why does this crash with access violation to 0xcccccc...?
seems to work fine std::vector does not reallocate itself to expand when you access it like an array like that. What you should be doing instead of
TAG : cpp
Date : November 26 2020, 07:01 PM , By : user3863313
How to find out how namespace got polluted?
How to find out how namespace got polluted?
To fix this issue grep might be useful anyway. Do a search for "^using namespace". There's a pretty fair chance that inside a function it'll be indented, but outside it won't be...
TAG : cpp
Date : November 26 2020, 07:01 PM , By : Sharif Sheikh
What is the _REENTRANT flag?
What is the _REENTRANT flag?
should help you out Defining _REENTRANT causes the compiler to use thread safe (i.e. re-entrant) versions of several functions in the C library.You can search your header files to see what happens when it's defined.
TAG : cpp
Date : November 26 2020, 07:01 PM , By : chandu
Managing many objects at once
Managing many objects at once
I wish did fix the issue. How to keep track of the objects depends very much on what you want to do with them. Do you need to quickly access some particle known by index? Then use a vector. Are your particles somehow mapped by names? Then you can use
TAG : cpp
Date : November 26 2020, 07:01 PM , By : user3857262
How to create ActiveX DLL in Visual C++
How to create ActiveX DLL in Visual C++
seems to work fine There are a lot of details to get right. Best thing to do is to use ATL and the built-in ATL object wizard. It auto-generates a bunch of files so that the IDL, type library, registration script, class wrapper and event proxies are
TAG : cpp
Date : November 25 2020, 07:01 PM , By : user3863208
Generic allocator class without variadic templates?
Generic allocator class without variadic templates?
this one helps. When you need to target pre-C++0x compilers you need to provide pseudo-variadic templates, i.e. you need to provide a template function for every needed arity:
TAG : cpp
Date : November 25 2020, 07:01 PM , By : user116742
Comparation in JNI
Comparation in JNI
fixed the issue. Will look into that further You have 2 options (I'm assuming you want to compare for equality...) Convert both jstrings to wstrings and compare Call the equals method of the jstring (however this requires a couple of calls to the JVM
TAG : cpp
Date : November 25 2020, 07:01 PM , By : user3863171
Using a function with reference as a function with pointers?
Using a function with reference as a function with pointers?
I wish did fix the issue. Today I stumbled over a piece of code that looked horrifying to me. The pieces was chattered in different files, I have tried write the gist of it in a simple test case below. The code base is routinely scanned with FlexeLin
TAG : cpp
Date : November 25 2020, 07:01 PM , By : Rafiq Mahar
How to initialize an unsigned long long type?
How to initialize an unsigned long long type?
wish of those help I'm trying to initialize an unsigned long long int type. But the compiler is throwing an error , Try suffixing your literal value with ULL
TAG : cpp
Date : November 25 2020, 07:01 PM , By : Kendall Scott
How to practically customize IE context menu?
How to practically customize IE context menu?
it should still fix some issue See Adding Entries to the Standard Context Menu on MSDN.For some sample code, download and extract the Web Accessories for Internet Explorer 5 (the mechanism still works in IE versions up to and including 8). Look at ie
TAG : cpp
Date : November 25 2020, 07:01 PM , By : user3863079
Trying to Create a ToolBar with an ImageList, not working
Trying to Create a ToolBar with an ImageList, not working
it helps some times Whats "not working". CreateMappedBitmap is used for loading images that have a color table - which means they have
TAG : cpp
Date : November 25 2020, 07:01 PM , By : user3863049
How does the destructor know when to activate itself? Can it be relied upon?
How does the destructor know when to activate itself? Can it be relied upon?
this one helps. For a stack created object, the destructor is automatically called when the object goes out of scope. For an object created on the heap, the memory will be freed only when you explicitly call delete.
TAG : cpp
Date : November 25 2020, 07:01 PM , By : Lyrha Cabunilas
Conway's Game of Life - C++ and Qt
Conway's Game of Life - C++ and Qt
Does that help It looks like the timer is set up correctly to me. For the timerFired() function, I would not create a temporary matrix of GridCell objects, but just a temporary matrix of flags that indicate whether the cell is live or not. These flag
TAG : cpp
Date : November 25 2020, 07:01 PM , By : Rod
Accessing any structs members at run-time
Accessing any structs members at run-time
To fix this issue Sure. If you have a struct and you know the offset and the type of the member variable, you can access it using pointers.
TAG : cpp
Date : November 25 2020, 07:01 PM , By : Josh Hsu
Including #includes in header file vs source file
Including #includes in header file vs source file
With these it helps Generally, you only want to put the minimum necessary includes into a class header file, as anyone else who uses that header will be forced to include all of them too. In larger projects, this leads towards slower builds, dependen
TAG : cpp
Date : November 25 2020, 07:01 PM , By : user3863010
How does switch compile in Visual C++ and how optimized and fast is it?
How does switch compile in Visual C++ and how optimized and fast is it?
wish help you to fix your issue A switch is often compiled to a jump-table (one comparison to find out which code to run), or if that is not possible, the compiler may still reorder the comparisons, so as to perform a binary search among the values (
TAG : cpp
Date : November 25 2020, 07:01 PM , By : vanwichen_daniel
How to override nested C++ objects methods?
How to override nested C++ objects methods?
may help you . Don't make the encryption object a descendant. Make it a decorator or proxy. The main object shouldn't need to know whether it's encrypting things. Instead, it will have a data-transfer object (the socket class) that sends and receives
TAG : cpp
Date : November 25 2020, 07:01 PM , By : user3862971
penalty for "inlined" classes
penalty for "inlined" classes
it fixes the issue Visual studio allow you to create "inlined" classes (if I am not mistaken with the name). So class header and implementation all in one file. , any penalty for doing it that way? any disadvantages?
TAG : cpp
Date : November 25 2020, 07:01 PM , By : scenwong
C++ Library for implementing a web services api over legacy code?
C++ Library for implementing a web services api over legacy code?
fixed the issue. Will look into that further Microsoft has put out native code webservices API (WWSAPI) that looks pretty decent. I haven't had a chance to use it yet. We had originally ignored it, since it required Windows 7 or Server 2008, but they
TAG : cpp
Date : November 25 2020, 07:01 PM , By : josenet
C++-Singleton class
C++-Singleton class
I hope this helps you . singleton has private constructor so inheritance is not possible. besides singleton has static methods to instantiate private instance member and since you can't override static methods it would be pointless to inherit from si
TAG : cpp
Date : November 25 2020, 07:01 PM , By : mws
Floating point precision in Visual C++
Floating point precision in Visual C++
To fix this issue The complier option you want for Visual Studio is /fp:strict which is exposed in the IDE as Project->Properties->C/C++->Code Generation->Floating Point Model
TAG : cpp
Date : November 25 2020, 07:01 PM , By : Yegor Terokhin
Compiler error when overriding virtual methods
Compiler error when overriding virtual methods
Hope that helps Using VC71 compiler and get compiler errors, that i don't understand. Here comes the example
TAG : cpp
Date : November 24 2020, 07:00 PM , By : Lincoln Lamas
What is the point of function pointers?
What is the point of function pointers?
Hope this helps Most examples boil down to callbacks: You call a function f() passing the address of another function g(), and f() calls g() for some specific task. If you pass f() the address of h() instead, then f() will call back h() instead. Basi
TAG : cpp
Date : November 24 2020, 07:00 PM , By : sosanhanoi
Which is faster in memory, ints or chars? And file-mapping or chunk reading?
Which is faster in memory, ints or chars? And file-mapping or chunk reading?
hope this fix your issue Memory mapped files are usually the fastest operations available if you require your file to be available synchronously. (There are some asynchronous APIs that allow the O/S to reorder things for a slight speed increase somet
TAG : cpp
Date : November 24 2020, 07:00 PM , By : Undead Cosmonaut
ISO file in C++
ISO file in C++
will be helpful for those in need I don't know very much about this topic, but a simple google search answered me back this page with even sample code (I spent less than one minute):http://www.codeproject.com/KB/winsdk/IMAPI2.aspx
TAG : cpp
Date : November 24 2020, 07:00 PM , By : thanhd
Expected Class-name before { token
Expected Class-name before { token
wish helps you class FxActionData; is a *forward declaration. It doesn't hurt anything but allows for not dragging in a full header file for, say, just a pointer to a class. It's useless in your case here.The CP_M_RefCounted is probably a template (o
TAG : cpp
Date : November 24 2020, 07:00 PM , By : 0xFFFFFFFF
Can I trust floats or doubles representing integers to retain precision?
Can I trust floats or doubles representing integers to retain precision?
it should still fix some issue IEEE-754 single-precision float has only 24 bits of mantissa, so obviously it can't represent exactly all integers in the 32-bit rangeFor example if x = 16777216.0f, y = 1.0f then x + y is not equal to 16777217
TAG : cpp
Date : November 23 2020, 07:00 PM , By : Slater Colteryahn
Qt execute multiple get with QNetworkAccessManager
Qt execute multiple get with QNetworkAccessManager
will help you I have tested your code and I have not noticed that the GUI is blocked, in addition to using signals and slots you should not have that problem. However I see that you are creating dynamic memory unnecessarily, in the following code I c
TAG : cpp
Date : November 23 2020, 07:00 PM , By : Misael Ramirez Muñiz
Big and Little endian question
Big and Little endian question
it fixes the issue The way I think about endian issues, is that there are numbers (when they are in the machine's endian order) and there are blobs of binary data (when they are not in the machines endian order).When you think like this, you realize
TAG : cpp
Date : November 23 2020, 07:00 PM , By : apace626
Visual Studio 2008 compiles anything in C++ file?
Visual Studio 2008 compiles anything in C++ file?
hope this fix your issue The part before the include "stdafx.h" line is actually explainable (given that the file is actually compiled): everything before and including that line is ignored if precompiled headers are enabled (which is the default). S
TAG : cpp
Date : November 23 2020, 07:00 PM , By : Lori Castillo
C++ pointer to functions, Beginner Question
C++ pointer to functions, Beginner Question
should help you out Function will be implicitly casted to a pointer according to C++ Standard (4.3/1). There is no difference. However this conversion never applies to nonstatic member functions. For them you should explicitly write .
TAG : cpp
Date : November 23 2020, 07:00 PM , By : user3862538
Fastest algorithm for primality test
Fastest algorithm for primality test
To fix this issue One good method is the Miller-Rabin test. It should be noted however, that this is only a probabilistic test.
TAG : cpp
Date : November 23 2020, 07:00 PM , By : user3862521
Passing array of pointers to another class
Passing array of pointers to another class
around this issue If you want to pass the whole array, the constructor should look like this:
TAG : cpp
Date : November 23 2020, 07:00 PM , By : user3862492
Handling macro redefinition without modifying .h files ... C / C++ language
Handling macro redefinition without modifying .h files ... C / C++ language
Any of those help Macro expansion happens at the preprocessor level and is impervious to namespace use.Are all macros that you want to use simple constants, not used in token concatenation etc.?
TAG : cpp
Date : November 23 2020, 07:00 PM , By : tricky_periwinkle
Implement SSL with SSPI: How to start?
Implement SSL with SSPI: How to start?
Hope this helps Google suggested this site: http://www.codeproject.com/KB/IP/sslclasses.aspx
TAG : cpp
Date : November 23 2020, 07:00 PM , By : Andrea De Santis
Creating a simple VS2008 visualizer inside autoexp.dat (problem with casting)
Creating a simple VS2008 visualizer inside autoexp.dat (problem with casting)
may help you . Visual studio's visualiser is blind to typedefs and will think StringHandle is a void *.
TAG : cpp
Date : November 23 2020, 07:00 PM , By : user3862394
C++ - Unicode Newline
C++ - Unicode Newline
To fix the issue you can do The entire file is either 8-bit or 16-bit characters, as determined by the UTF-16 BOM in the first two bytes. You can't change between them. When you write out an 8-bit newline character, that throws off the processing on
TAG : cpp
Date : November 22 2020, 07:01 PM , By : Tijana Vezmar
Program crashing with 'std::out_of_range' error
Program crashing with 'std::out_of_range' error
fixed the issue. Will look into that further I am working on a wheel of fortune project for school and am running into some issues with pointers.
TAG : cpp
Date : November 22 2020, 07:01 PM , By : Vinicius Branco
Use signed or unsigned char in constructing CString?
Use signed or unsigned char in constructing CString?
Any of those help LPCSTR is just const char*, not const signed char*. char is signed or unsigned depending on compiler implementation, but char, signed char, and unsigned char are 3 distinct types for purposes of overloading. String literals in C++ a
TAG : cpp
Date : November 22 2020, 07:01 PM , By : Milan Vasovic
Parallel execution policies in C++ 17
Parallel execution policies in C++ 17
will be helpful for those in need In VS 15.8 generate is not implemented as a parallel function. So if the time for the code is dominated by the generate function, there will be no significant difference in the execution time of your sample code.Also
TAG : cpp
Date : November 22 2020, 07:01 PM , By : kiyakaelar
C++ Class Templates (Queue of a class)
C++ Class Templates (Queue of a class)
To fix this issue Ok, so I have my basic linked Queue class with basic functions such as front(), empty() etc.. and I have transformed it into a template. Now, I also have a class called Student. Which holds 2 values: Student name and Student Id. I c
TAG : cpp
Date : November 22 2020, 07:01 PM , By : David W
Convert image into useable byte array in C?
Convert image into useable byte array in C?
this one helps. The ImageMagick library can do this too, although often it provides enough image manipulation functions that you can do many things without needing to convert the image to a byte array and handle it yourself.
TAG : cpp
Date : November 22 2020, 07:01 PM , By : user3862281
pointer to preallocated memory as an input parameter and have the function fill it
pointer to preallocated memory as an input parameter and have the function fill it
To fix this issue Test code: ,
TAG : cpp
Date : November 22 2020, 07:01 PM , By : jOkes7
Animated Image in Win32
Animated Image in Win32
Hope that helps Not sure if GDI+ could be considered as native win32. In case you can use it check the following example: CodeProject
TAG : cpp
Date : November 22 2020, 07:01 PM , By : Pritika Roy
error on compiling statically linked library created in Qt
error on compiling statically linked library created in Qt
I hope this helps you . If you can compile some parts with errors but only get compile errors when you include Qt parts in the QtGui module, then you may need to look at your .pro file and make sure that you DON'T have QT -= gui.
TAG : cpp
Date : November 22 2020, 07:01 PM , By : user3862094
How to easily pass a very long string to a worker process under Windows?
How to easily pass a very long string to a worker process under Windows?
around this issue One possible strategy is to create a named Pipe and pass the handle ( or pipe name) to the other process. Then use normal Read\Write operations on Pipe to extract the data.
TAG : cpp
Date : November 22 2020, 07:01 PM , By : davhin
Can a class add friend classes at runtime in C++?
Can a class add friend classes at runtime in C++?
To fix the issue you can do I'd like to make some classes become friends of other classes at runtime. Is there a way to do this?
TAG : cpp
Date : November 21 2020, 07:01 PM , By : Brad Culley

shadow
Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk