General C++ Programming - May 2019 (Page 7)

Need Preprocessor macro
 
Hello, who can help me. I need one preprocessor macro. Input: Name result: Modulename_Name #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, ...
[5 replies] Last: ...and in C++17, you should be using filesystem::path for this kind of... (by Duthomhas)
2D Array Puzzle
 
Good evening, I am working on my final project for my C++ class and have run into a snag with my program. There seems to be a problem with my array and const i...
[5 replies] Last: Lines 23, 42, & 63: You've defined scores 3 times with 2 different t... (by dhayden)
Code applies wrong value in certain situations
 
I have a code section that was updated to write to a single bit in a file a flag of 1 or 0. A 1 = speed is in a 5ph increment, i.e. 55mph. A 0 = speed was divis...
[5 replies] Last: A 0 speed value is a valid value and seems to be part of the cause he... (by dhayden)
Poker StraightFlush and FourofaKind
 
#include <iostream> #include <cstdlib> #include <ctime> #include <vector> using namespace std; string r ={ "Two","Three","Four", "Five", "Six",...
[10 replies] Last: You don't need to sort to check for a flush. Just check if all cards h... (by dhayden)
Sub-Namespaces for organizing features: Yes or No?
 
I've been working on a personal library called J118 for a while now, and it's starting to gain in size. It's just a personal project I do for fun and to learn n...
[9 replies] Last: Documenting dependencies. That is something I hadn't considered. Tha... (by George P)
Help with HashMap / typename declarations
 
I am working on a HashMap to learn C++ and I am using iterators and const_iterator classes to go through my HashMap. I am also using vector/list and pair to rep...
[1 reply] : The compiler doesn't know that std::list<std::pair<key_type, mapped_t... (by Peter87)
Unary Opeartions Inside Ternary Operator
 
Hi Guys , As per the operator precedence table, unary operators have a higher precedence over ternary operator,then in the below given example ,why this rule ...
[6 replies] Last: Thanks everybody for your explanations,I got it . ne555 thx for usi... (by NiharRNanda)
by slei
Working with ptr to items in containers, thoughts?
 
I recently see my self often trying to take pointers from non dynamic allocated objects from smaller containers, and it seems to work fine. for example std::...
[5 replies] Last: By reading it, this would mean it is actually safe, and wouldn't inva... (by mbozzi)
Matrix and vector multiplication in different classes
 
I want to calculate the matrix multiplication with a matrix and a vector. the matrix and vector have their own class files, and I want to multiply a vector wit...
[4 replies] Last: The real problem is the manipulation of matrix and vector in vector cl... (by zaahm18)
Comparing 2 literal strings
 
I saw a member asking about a game like 'Boggle', and thought that sounded like a nice project to write. I made a struct to hold the words in a dictionary.. (3...
[4 replies] Last: @JLBorges Thank you for your answer. I did forget to put in the '== 0... (by whitenite1)
by Ryan15
Is there another way to stop this do while loop mid-loop?
 
without the break statement, the output would exceed 100 once before it stops. eg: Multiply= 5 Multiply=25 (this is where the break statement would h...
[7 replies] Last: I thought it was about the actual result of multiply and not just what... (by Ganado)
by Ojies
Input loop always does first option
 
There is a loop from lines 750-970 that has 2 options in an if statement for when you input a string for the variable "input". When it asks you to input somethi...
[4 replies] Last: Shouldn't the syntax be something like this in your 'if' statements ?... (by kavala)
May 2019 Pages: 1... 567
  Archived months: [apr2019] [jun2019]

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