Beginners - August 2017 (Page 15)

A question about private data type?
 
Hi. Using private data type is not clear for me, for example I want to make a class, it has some private variables in it so as to I can control the users if t...
[4 replies] Last: Thank you. I got it. (by omer123)
Else without a previous if
 
Hi! How are you? Im starting on C++ and I had this problem before and it was because of the braces, I used them this time but it keeps telling me that i have el...
[5 replies] Last: Use and editor or IDE that will do automatic indenting. That can reall... (by dhayden)
How do programmers know what's inside my custom library?
 
After I created a graphic library for example and then if I want to distribute it to other people to use, how do they know how to use my library and what's insi...
[5 replies] Last: Thanks friends for your answers. (by omer123)
Finding multiple peaks from a vector
 
Can anyone help me with finding multiple peaks given a vector with amplitudes? I need to use the first difference as well as the smooth difference(median of ...
[7 replies] Last: @lastchance - thank you for your help. I will try smoothing out the or... (by ivar5000)
C++ LUDO GAME HELP
 
I HAVE TRIED TO WRITE A BOARD GAME (LUDO) IN GUI USING C++ ALTHOUGH ITS NOT WORKING AT ALL MANY ERRORS WHEN I USED CODE BLOCKS KINDLY SOMEONE HELP htt...
[no replies]
Matreix Class not working
 
Hi I'm new to OpenGL(idk if I have already 4 months of learning it it's called new), and I have passed successfully my matrix to the shader, my matrix was an te...
[6 replies] Last: Solved! All I had to do was to make operator to return a reference to ... (by DirtyBlasion)
Function not returning what I expected
 
Hi, I have the following function: /* proposal distribution */ void dist(double paraest ,double sigscale ,int npara){ paraest =0.5; paraest =0.5; ...
[18 replies] Last: @jlb: thanks for the info! @Enoizat: yes, you did mention in your ear... (by lifeisgood)
what is the use of vector::get_allocator?
 
What is the use of get_allocator ?? I've read a program from this site, but I couldn't understand the 15th line. What is myvector.get_allocator().construct(&p ,...
[2 replies] Last: Thank you for the reply :) (by rajhansk)
by TheArk
do while loop fail
 
Any Idea why this won't compile? Error message says 72:1: error: expected unqualified-id before 'do' I don't know what is wrong in my do while loop #incl...
[2 replies] Last: See also duplicate post: http://www.cplusplus.com/forum/general/219747... (by Chervil)
How do I proceed?
 
I have been learning c/c++ for many months and I am still beginner, but I want to go to more advanced level. My question is how do I approach to the next lev...
[6 replies] Last: @boost lexical cast Command line tool idea is cool, how do I proceed ... (by rajhansk)
Lambda capture
 
If there is a lambda capture [=, &var] does it mean that it can access all the variables in the scope in which it is defined by value except for var? Also does ...
[4 replies] Last: Uh, I see what you mean. Thanks a lot for your kind explanation, mbozz... (by Enoizat)
Problems with the default constructor attributes initialisation
 
This is my code: #include <iostream> using namespace std; class dumb_array { int mSize; int* mArray; public: //default constructor dumb_array(int ...
[10 replies] Last: Well, don't std::string and std::vector (just for example) by default... (by Thomas1965)
When to use try{} catch{<exeption>} block)?
 
I am reading information about exception handling and I wonder when should I write the try{} catch{<exception>} block. Until know I only use it when the IDE s...
[4 replies] Last: [quote=puertas12]I wonder when should I write the try{} catch{<excepti... (by Cubbi)
Reallocating char* array size
 
I am trying to have an array of strings, but I can't quite figure out how I'd allocate an array of strings. What I want to do: char **wordlist, **respons...
[5 replies] Last: Jumping on the bandwagon, here's a solution where wordlist and respons... (by dhayden)
Overload + operator to concatenate strings using strcat() <cstring>
 
- Experts, I am trying to overload the "+" operator to concatenate string using the function strcat(string dest, string src). Looking at the signature of strca...
[9 replies] Last: Thanks @Cubbi (by puertas12)
expected unqualified-id before 'for'
 
Hello! I have this code (I put just a part of it): class TMTrackAnalyzer : public edm::EDAnalyzer { public: # declare public stuff here ...
[5 replies] Last: I don't understand you ¿what's the purpose of the loop? > map< Obj... (by ne555)
GetAsyncKeyState() during a Sleep() does not register immediately
 
In the program I am writing when I hit the 'escape' key, I want it to exit immediately. Currently it waits until the end of the sleep statement before registeri...
[4 replies] Last: A rather clunky approach using Sleep(). Here the escape key is tested... (by Chervil)
elseif shorthand
 
Hello, I know there is a shorthand for if and else conditions, it is as follows A = (B<C)? B:C; What about elseif? the condition appears to only...
[3 replies] Last: Thanks a lot. @Zhuge and @mbozzi Now I know better. David. (by davBams)
Declaring an array inside function
 
hello, I have recently tried to create a function that sums two different arrays. For this, inside the function, I need to declare a double pointer (double **po...
[7 replies] Last: Thanks for the replies guys, I think I managed to overcome the confuss... (by zaratustra)
by wsme
Terminal Crashing on Switch statement
 
Hey all, Wanted to make a guessing game based on a random number to be guessed by a player. I was able to compile successfully, but the terminal would crash aft...
[8 replies] Last: A simple way to implement jonnin's idea. #ifdef _DEBUG const unsigne... (by Thomas1965)
August 2017 Pages: 1... 1314151617
  Archived months: [jul2017] [sep2017]

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