logo
down
shadow

CPP QUESTIONS

C++ Dynamically Allocated Array; Size set by quantity of user input; Writing to a file;
C++ Dynamically Allocated Array; Size set by quantity of user input; Writing to a file;
hope this fix your issue , Most likely, this is what you want to do:
TAG : cpp
Date : December 05 2020, 12:24 PM , By : Patricia Vogler
enums to be defined as uint8_t variables in structure
enums to be defined as uint8_t variables in structure
This might help you Even prior to C++11, if you take care that all of your enum values are less than 128, you can simply store them in a uint8_t variable. This may require casting when they're used, though. This is a common way to squeeze enum values
TAG : cpp
Date : December 05 2020, 12:24 PM , By : TheLazyDog343
C++ Overloaded Constructor issues
C++ Overloaded Constructor issues
I hope this helps . I'm trying to create an overloaded constructor inside my player.cpp but it's giving me the error that there is no instance of overloaded function "player:player" matches the specified type. , You forgot to:
TAG : cpp
Date : December 05 2020, 12:24 PM , By : Katelyn Kasperowicz
Fast CSV parser in C++
Fast CSV parser in C++
it fixes the issue An efficient method for parsing or for that matter processing of files is to read as much of the file into memory before you start parsing. File I/O has been, since the dawn of computers, one of the slower parts of a computer syste
TAG : cpp
Date : December 05 2020, 12:24 PM , By : Bhaskar reddy
MFC GUI application rewrite - threading, messaging, Document/View, etc. Advice needed
MFC GUI application rewrite - threading, messaging, Document/View, etc. Advice needed
I think the issue was by ths following , Re messages and message mapping: The windows message queue does not interrupt your program or thread. Messages wait in the queue until you return to the message loop, then it dequeues and dispatches the next m
TAG : cpp
Date : December 05 2020, 12:18 PM , By : Ryan Nguyen
How to get frame feed of a video in OpenCV?
How to get frame feed of a video in OpenCV?
I hope this helps . I'm assuming you want to store the frames. I would recommend std::vector (as GPPK recommends). std::vector allows you to dynamically create an array. The push_back(Mat()) function adds an empty Mat object to the end of the vector
TAG : cpp
Date : December 05 2020, 12:18 PM , By : user4642879
saving data structure c++ to disk
saving data structure c++ to disk
seems to work fine boost::serialization could do it. Note: write the archive version first and then do register_types
TAG : cpp
Date : December 05 2020, 12:18 PM , By : JoeEngineer
Vector of pointers: some clarification needed
Vector of pointers: some clarification needed
will help you To answer your original question: No, you don't need to delete individual CPoint objects (in fact you can't). But I do believe that you'd be better off using vector to store the actual point, rather than a pointer to it.
TAG : cpp
Date : December 01 2020, 04:55 PM , By : Acey
scaling a bitmap without losing quality
scaling a bitmap without losing quality
This might help you If you use bitmaps you simple can't do scaling without the problems you have. If you want scaling where e.g. a one-pixel border stays a one-pixel border, then you have to use a vector-based format for your images.
TAG : cpp
Date : December 01 2020, 04:55 PM , By : Shannon White
How to evaluate a function directly?
How to evaluate a function directly?
Does that help Title may not make any sense but I dont really know how to explain this. I have a class called polynomial and lets say I defined a polynome called p1 which is 2x+4. What I want to do is calculate p1(5) directly. I dont want anything li
TAG : cpp
Date : December 01 2020, 04:55 PM , By : Arijit Das
QNetworkAccessManager: How to change post data at createRequest function
QNetworkAccessManager: How to change post data at createRequest function
should help you out You can use the appropriate outgoingData argument.http://qt-project.org/doc/qt-5.1/qtnetwork/qnetworkaccessmanager.htmlcreateRequest
TAG : cpp
Date : December 01 2020, 04:55 PM , By : shoowopadidydidy
Returning std::move of a local variable
Returning std::move of a local variable
it helps some times A compiler should use a move constructor, but I didn't see an obligation in the standard : It's always said "Copy/move constructor" in the section concerning temporary objectsstandard ISO/IEC 14882:2011 C++ :
TAG : cpp
Date : December 01 2020, 04:55 PM , By : Rufus
Is there a fast linear SVM library with a good C++ interface?
Is there a fast linear SVM library with a good C++ interface?
will help you The best you will find is LIBLINEAR in my opinion. Alternatives are SVM^PERF, and Pegasos (barely documented). They all have very similar interfaces. You won't find a library with similar performance with a C++ interface. Not because C+
TAG : cpp
Date : December 01 2020, 04:55 PM , By : Luke Lamberson
What is the purpose of name mangling in C++?
What is the purpose of name mangling in C++?
With these it helps The linker doesn't know about overloading (it has to be generic for multiple languages). All it knows about are symbols that it needs to resolve.The compilers name-mangling creates two different symbols for the two function overlo
TAG : cpp
Date : November 29 2020, 01:01 AM , By : Rajendran J
C++ Why the void function is not working eventhough I called it?
C++ Why the void function is not working eventhough I called it?
wish of those help I do not know how to use the debugger and I think thad I do not have one So I am trying to create simply linked list in c++ Called Product this list will be used to store product... and I have already made a function that add a new
TAG : cpp
Date : November 29 2020, 01:01 AM , By : Yezz
How the pointer and the pointer's adress can share the same memory adress?
How the pointer and the pointer's adress can share the same memory adress?
this will help ar is the address of the array, its type is "pointer to an array of three integers".
TAG : cpp
Date : November 29 2020, 01:01 AM , By : user5943579
error C2220: warning treated as error - no 'object' file generated
error C2220: warning treated as error - no 'object' file generated
seems to work fine The error says that a warning was treated as an error. Therefore your problem is a warning message! Check them and fix these.In case you don't know how to find them: Open the Error List (View > Error List) and click on Warning.
TAG : cpp
Date : November 29 2020, 01:01 AM , By : TonyC
exception of strcpy function in c++ console program
exception of strcpy function in c++ console program
fixed the issue. Will look into that further str2 is an uninitialised pointer. strcpy does not allocate memory so is currently trying to write to an arbitrary address which you don't own and very likely isn't writable by your code.You need to point s
TAG : cpp
Date : November 29 2020, 01:01 AM , By : Mia Louise Søgaard
How to access USB barcode scanner data directly from USB port using C/C++ without driver
How to access USB barcode scanner data directly from USB port using C/C++ without driver
I hope this helps . Most barcode scanners can work as simple usb-to-serial converters and thus you get a ttyusbx device in /dev. The way this usually works is you download some software or manual from the manufacturer's website and scan a barcode or
TAG : cpp
Date : November 29 2020, 01:01 AM , By : Pratik Mulye
Under which circumstances will std::vector.clear() call a destructor?
Under which circumstances will std::vector.clear() call a destructor?
I wish this helpful for you Switching between struct and class won't make any difference -- you're correct that the only difference between them is default visible (public for structs, private for classes).What matters is whether the items in the con
TAG : cpp
Date : November 29 2020, 01:01 AM , By : Kyle
Template partial specialisation and dependent names
Template partial specialisation and dependent names
Any of those help When you use a template, indeed you are defining a new type, even for template specialization.So, the correct way for your program to work is redifining the specialization completely.
TAG : cpp
Date : November 29 2020, 01:01 AM , By : pbbaer
best way to share data between c codes
best way to share data between c codes
seems to work fine You can use shared memory IPC, which simply allows you to access the same physical memory from multiple cooperating processes. I say cooperating because they need to be careful about synchronization, or reads may observe partially
TAG : cpp
Date : November 28 2020, 08:01 AM , By : Shubhadeep Sarkar
C++ ignores if statement conditions
C++ ignores if statement conditions
it should still fix some issue In C and C++, the || operator is a binary operator. And non-zero values are true. Your expression:
TAG : cpp
Date : November 28 2020, 08:01 AM , By : Deron Satchell
How to set the argv[ ] to be case-insensitive in a Win32 Console Application?
How to set the argv[ ] to be case-insensitive in a Win32 Console Application?
This might help you Solved below. , If boost is an option then you can use iequals
TAG : cpp
Date : November 28 2020, 08:01 AM , By : SurcoufsFox
How to fix error "clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)"?
How to fix error "clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)"?
will help you It looks like you only compiled main.cpp but not pattern.cpp. When it came time to link the executable together, functions defined in pattern.cpp won't be found. The undefined reference indicates your main.cpp is using pattern(int, int)
TAG : cpp
Date : November 28 2020, 08:01 AM , By : Ted Tseng
C++ How do I print a .txt file verbatim?
C++ How do I print a .txt file verbatim?
it should still fix some issue To just print out text file use this cout
TAG : cpp
Date : November 28 2020, 08:01 AM , By : JSpielvo
Creating two dimensional array of class
Creating two dimensional array of class
may help you . There is really no reason to use raw pointers in your scenario. I'd suggest holding the board as a single dimensional std::vector, and simply use multiplication to of the row/column when iterating the board.
TAG : cpp
Date : November 28 2020, 08:01 AM , By : syeda
How do I correctly use COMMTIMEOUTS with OVERLAPPED IO mode reading from a Serial port
How do I correctly use COMMTIMEOUTS with OVERLAPPED IO mode reading from a Serial port
should help you out I am trying to use the overlapped IO mode on Windows 7/8 X64 to emulate the non blocking mode (IO_NONBLOCK) behavior supported by Linux's open flags. The code here is part of the windows portion of a cross platform serial API.
TAG : cpp
Date : November 28 2020, 08:01 AM , By : Guillaume
An assert macro which expands to static_assert when possible?
An assert macro which expands to static_assert when possible?
it should still fix some issue This is a slightly crazy solution.Uncomment the Const c; foo(c); line and you'll see that it won't compile. This is the compile-time assert.
TAG : cpp
Date : November 28 2020, 08:01 AM , By : Miguel Angel Chávez
How to write a copyconstructor for a class which has HANDLE as a member in win32 c++ application?
How to write a copyconstructor for a class which has HANDLE as a member in win32 c++ application?
like below fixes the issue You're having this problem because you're trying to define a copy constructor for a class that contains an abstract resource (as opposed to a value). You'll have to decide what behavior you actually want from your copy cons
TAG : cpp
Date : November 28 2020, 08:01 AM , By : annabelle
C++ saving info such as tree in a file
C++ saving info such as tree in a file
will be helpful for those in need One option is to use Boost Property Tree, that can help you to load and store tree structures into the xml files (and several other formats are supported as well). This library is well documented, you can find many e
TAG : cpp
Date : November 28 2020, 08:01 AM , By : Paul Burkhaulter
Transforming an expression template tree
Transforming an expression template tree
To fix the issue you can do Although the OP wanted a solution that didn't use Boost.Proto, others might be interested to see how this could be (pretty easily) done using it:
TAG : cpp
Date : November 28 2020, 01:01 AM , By : user4641895
How to overload an operator with multiple parameters like a + b + c?
How to overload an operator with multiple parameters like a + b + c?
I wish this helpful for you That's because there is no such operator in general.a + b + c is (a + b) + c. First a + b, then the results of that added to c.
TAG : cpp
Date : November 28 2020, 01:01 AM , By : sanjay
C++ 11 with Raspberry Pi performances
C++ 11 with Raspberry Pi performances
Hope this helps The only thing I can come up with for performance if you use any of the following new features.http://en.wikipedia.org/wiki/C%2B%2B11Core_language_runtime_performance_enhancements
TAG : cpp
Date : November 28 2020, 01:01 AM , By : Tim Alba
Make a C++ class look like a numpy array using swig
Make a C++ class look like a numpy array using swig
I hope this helps you . If n_cols and n_rows are (effectively) immutable, your best course of action is to simply create a real numpy array, giving it m_data as storage and (n_rows, n_cols) as shape. That way you will get all the numpy array faciliti
TAG : cpp
Date : November 28 2020, 01:01 AM , By : Justin Farris
Postfix incrementer overloading for nested enumerated types
Postfix incrementer overloading for nested enumerated types
I hope this helps you . The problem is that there is no way you can use a member operator here. A member operator always operates on the class of which it is a member, and since you want it to operator on an enum, and not on a class, it cannot be a m
TAG : cpp
Date : November 28 2020, 01:01 AM , By : Tanoski Nikolce
Is there a tidy way of associating metadata with functions in C++
Is there a tidy way of associating metadata with functions in C++
I wish this helpful for you You can do that with a template specialized by an address of a function:
TAG : cpp
Date : November 28 2020, 01:01 AM , By : Tyron-Lee
QObject::installEventFilter(): Cannot filter events for objects in a different thread
QObject::installEventFilter(): Cannot filter events for objects in a different thread
wish help you to fix your issue If you're using QtCreator set "Stop when qWarning() is called" option, that is located in Options -> Debugger -> GDB Extended.After that start your app in debug mode (F5). When that warning is issued QtCreator will sto
TAG : cpp
Date : November 28 2020, 01:01 AM , By : mehdi hosseini
LNK2005 error with Zxing C++
LNK2005 error with Zxing C++
I wish this help you The problem has been solved (for now). The CHARACTER_SET was instantiated in the .h file and not in the cpp. For a reason that I do not know, the Visual compiler does not allow that, while there was no problem with GCC.Old code:
TAG : cpp
Date : November 28 2020, 01:01 AM , By : Carsten Wuttke
C++ Doubly Linked List with Pointers: Object of class isn't constructed properly
C++ Doubly Linked List with Pointers: Object of class isn't constructed properly
wish of those help I think what I'd start with is your print function, which doesn't deal well with the case where the list is empty. Here I've made sure not to use the pointer current when it's null. We can be sure that it's safe to use it within th
TAG : cpp
Date : November 27 2020, 01:01 AM , By : Aarzoo Varshney
Using a random string generator in c++ constructor
Using a random string generator in c++ constructor
help you fix your problem You call srand(time(NULL)) every time. That seeds the random number generator. If you call it within the same second, it has the same seed, and produces the same results.
TAG : cpp
Date : November 27 2020, 01:01 AM , By : L. Trong
What should I use instead of void as one of the alternative types in an variant?
What should I use instead of void as one of the alternative types in an variant?
Any of those help What you really want is a type among the alternatives which has a single possible value - not void, which has no possible values (and is problematic in other ways). In other words: A unit type instead of a bottom type. The standard
TAG : cpp
Date : November 27 2020, 01:01 AM , By : DisplayName=
C++ return value from multithreads using reference
C++ return value from multithreads using reference
will be helpful for those in need Here is my code: , objs is empty when first accessed, causing undefined behaviour:
TAG : cpp
Date : November 27 2020, 01:01 AM , By : Rajini gowtham
How to connect multiple TCP IP clients to same server port using c++
How to connect multiple TCP IP clients to same server port using c++
wish of those help I want to connect 2 clients to same server port using TCP IP. I have use the below code before bind:- // Reuse already binded socket
TAG : cpp
Date : November 27 2020, 01:01 AM , By : Gopal
Defaul compiler generates the reference operator (In C++)?
Defaul compiler generates the reference operator (In C++)?
I hope this helps you . No, that is not true. If there is no operator present, then the one in the core language is used.N3485 13.3.1.2 [over.match.oper]/1-2 (emphasis mine):
TAG : cpp
Date : November 27 2020, 01:01 AM , By : Léonard IMBERT
Unable to change directory time stamp after using FILE_FLAG_BACKUP_SEMANTICS
Unable to change directory time stamp after using FILE_FLAG_BACKUP_SEMANTICS
wish of those help As the MSDN page on SetFileTime explicitly documents the handle to the file you want to set the time on must have the FILE_WRITE_ATTRIBUTES privilege. And your handle, quite clearly, doesn't.
TAG : cpp
Date : November 27 2020, 01:01 AM , By : Jay Mathis
vector handling displaying output
vector handling displaying output
To fix this issue Vector data: Mary Daryl Cherry
TAG : cpp
Date : November 27 2020, 01:01 AM , By : Cândido Luís Dias Fe
WSAGetLastError returns WSAENOTSOCK - Cause?
WSAGetLastError returns WSAENOTSOCK - Cause?
I wish did fix the issue. Either: You never opened the socket. You have corrupted the handle value. You have closed the socket and then continued to use it.
TAG : cpp
Date : November 27 2020, 01:01 AM , By : Jim
C++: How to overload pow for user type?
C++: How to overload pow for user type?
it should still fix some issue You are not allowed to overloaded function into the std namespace. A typical solution for this is to declare your function in the same namespace as the custom type like
TAG : cpp
Date : November 26 2020, 01:01 AM , By : Dias
C++ using arrays as multidimensional despite initalising it as 1D with pointer
C++ using arrays as multidimensional despite initalising it as 1D with pointer
hope this fix your issue apperently this code works. , int *triangle[size] is an array of pointers. In your for loop you do
TAG : cpp
Date : November 26 2020, 01:01 AM , By : markliam10
How negate std::is_integral for use in tag dispatch?
How negate std::is_integral for use in tag dispatch?
fixed the issue. Will look into that further you may instantiate a std::integral_constant from a constexpr value like this:
TAG : cpp
Date : November 26 2020, 01:01 AM , By : Bhumika Gunjal
Retrieve serial number from USB memory (Windows environment c++)
Retrieve serial number from USB memory (Windows environment c++)
it fixes the issue You can check out this article:- http://oroboro.com/usb-serial-number/
TAG : cpp
Date : November 26 2020, 01:01 AM , By : bala nadar
g++ error: invalid preprocessing directive #INCLUDE
g++ error: invalid preprocessing directive #INCLUDE
may help you . It should be lowercase. Use include.Also, it's using namespace std; (typo in namespace).
TAG : cpp
Date : November 26 2020, 01:01 AM , By : Antonio Spinelli
C++ What is the std::for_each() function parameter type?
C++ What is the std::for_each() function parameter type?
wish helps you Here are a couple of snippets from my first successful use of the std::for_each() construct: , This is usually done through templates:
TAG : cpp
Date : November 26 2020, 01:01 AM , By : emesar ITPL
C++: Read individual lines from text file, sort words alphabetically
C++: Read individual lines from text file, sort words alphabetically
seems to work fine At least if I understand what you want correctly, I'd do something like this: Read a line into a string with std::getline. Initialize a std::stringstream from the string Read words from the stringstream into a vector Sort the vecto
TAG : cpp
Date : November 26 2020, 01:01 AM , By : Shashank K
Saving 'this' address into a variable
Saving 'this' address into a variable
This might help you void * is a more portable and, in my opinion, more correct way to store a pointer address:
TAG : cpp
Date : November 26 2020, 01:01 AM , By : Xaris Eufraimidis
c++ command line arguments in ubuntu terminal
c++ command line arguments in ubuntu terminal
wish of those help Create an output file of the same program. Do it by entering this in the terminal:
TAG : cpp
Date : November 26 2020, 01:01 AM , By : Alba García
Convert "Cartesian coordinates" to "polar coordinates with respect to user specified origin"
Convert "Cartesian coordinates" to "polar coordinates with respect to user specified origin"
wish helps you I am trying convert few points in my image to polar coordinates in OpenCV. I came across function called cartToPolar which will give me polar coordinates for my points with respect to 0,0 being my origin. However I want to do this conv
TAG : cpp
Date : November 26 2020, 01:01 AM , By : Jhon Micheal Domo Su
In what order are local scoped objects destructed?
In what order are local scoped objects destructed?
around this issue Will foo be destructed before bar, after bar, or is there no guarantee either way? , They are destroyed in the reverse order of their declaration. In
TAG : cpp
Date : November 26 2020, 01:01 AM , By : deepa
How to use SDL_MapRGB with SDL 2.0
How to use SDL_MapRGB with SDL 2.0
will help you I am trying to get a 24-bit color from rgb values. I want to use SDL_MapRGB, but I don't know what pixel format is. Since its SDL 2.0 I am using the SDL_Window and SDL_Renderer.
TAG : cpp
Date : November 25 2020, 07:27 PM , By : Filippo

shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org