Beginners - October 2023

by dialer
while(argc--,argv++) // c related question
 
this is more of a C related programming question . . . What would the following statement do? Does it loop through the first argument and corresponding argumen...
[7 replies] Last: As argv is a memory pointer this is effectively an infinite loop and... (by kigar64551)
Overloading operator<< for template instantiations: CRTP: error C2995: ... function template has already been defined
 
Say you want to define a class template, Foo<T> , whose instantiations: 1. have a string representation 2. define operator<< so that it can be directed to...
[2 replies] Last: Thanks for the clarification, mbozzi. You're right - I didn't correctl... (by ElusiveTau)
by Atom1
API Entry DllMain
 
Can someone explain, in layman's terms, what the purpose of the code below is. Is it required for the DLL to work properly? BOOL APIENTRY DllMain(HANDLE hM...
[3 replies] Last: Thank you for the comments. (by Atom1)
SDL generating sound without wav file
 
I am trying to Mix_LoadWAV_RW to play sound via SDL_RWops* rw, so not playing back a wav-file. Is the following approach the right one? A buffer from a ofstream...
[3 replies] Last: Here's an example that generates a 10-second long wave-file containing... (by mbozzi)
by Ganado
Initialize set based on field within array's class
 
Let's say I have code like this: #include <iostream> #include <numeric> #include <algorithm> #include <set> #include <iterator> enum Bar { A = 5...
[7 replies] Last: With C++11 we could already say std::transform(std::begin(bar_arr), s... (by mbozzi)
by Ch1156
Factory Class Pattern
 
Is this how you do a factory pattern? Im curious to learn since it will make my design a little easier to scale. My code is still a work in progress but I just ...
[3 replies] Last: Typically, a factory comes in play when you have inheritance and the o... (by longberns)
by demhat
EOF-unwanted loop!!!
 
The problem is that I want the first loop to be countered but the second with the sentinel value 'EOF' I wrote the program like this. However, when I entered Ct...
[11 replies] Last: Would have been a better choice. In c for the purpose of array size... (by seeplus)
SDL2 mixer error
 
When trying to load a wav-file to the mixer of SDL I get an error: undefined reference to `Mix_LoadWAV'. Also, Mix_OpenAudio is complaining that it has too many...
[2 replies] Last: As pointed out before, "error: undefined reference to XYZ" is a lin... (by kigar64551)
by Allaye
cant call a template function with auto return type in main
 
#include "iostream" #include "string" using std::cout, std::cin, std::endl, std::string; template <typename T, typename U> auto max(T x, U y); int main()...
[6 replies] Last: Putting code tags on the OP's code, as well as a bit of judicious refo... (by George PlusPlus)
XAudio2
 
When initializing xAudio2 in Eclipse there comes an error: undefined reference to `XAudio2Create'. IXAudio2* pXAudio2 = nullptr; if (FAILED(hr = XAud...
[1 reply] : Sound like a linker error. Probably you did not link the required im... (by kigar64551)
codeblocks debugging help
 
Hi. Can you assist me with issues of debugging cpp code in codeblocks on Ubuntu?
[no replies]
  Archived months: [sep2023] [nov2023]

This is an archived page. To post a new message, go to the current page.