General C++ Programming - September 2021

I made a cool calculator
 
Hey, I'm currently taking a introductory class for C++, I feel proud that I wrote a calculator progr...
[7 replies] Last: that is correct, the human has to mentally adjust the input. you get ... (by jonnin)
C++ Help Finding Occurrences of letter d
 
Have to do this and not sure how to do it. Need help with doing it. Instructions: Query the user ...
[4 replies] Last: The only real difference is that I count all the words and those start... (by seeplus)
c++ Temperature bar chart (1,2)
 
Can anyone help me out with this problem This is what I have so far: #include <iostream> #in...
[32 replies] Last: For a vertical chart, perhaps: #include <iostream> #include <string... (by seeplus)
const member fn
 
I got a doubt with const signature from the below code. can anyone help me correct my understandi...
[14 replies] Last: Of course. You have valid code when you don't try to make static membe... (by keskiverto)
virtual function performance (1,2)
 
I am seeing a performance issue with virtual functions and it impacts every function call with virtu...
[25 replies] Last: Your closing points seem fine, but I thought I'd add this to the inqui... (by Niccolo)
PURE VIRTUAL FN (1,2)
 
Is below code the right way to overload a pure virtual function? Can overload be only done if I am a...
[31 replies] Last: [quote=denver2020]All I am trying to figure out here is that if its a ... (by MikeyBoy)
Sprcificator %02X
 
Can I get this line in C++? for (i = 0; i < 8; i++) printf("%02X", key );
[3 replies] Last: See my edited post above. (by seeplus)
by jabeh
C++ Coding that create a function that open the contact file using struct, pointers, array, and classes
 
#include <iostream> #include <fstream> #include <string> using namespace std; void printCon...
[6 replies] Last: Very similar to this post here http://www.cplusplus.com/forum/beginner... (by seeplus)
I have a member function of class SparceMatrixStruct which should return a vector.
 
I have a member function of class SparceMatrixStruct which should return a vector. std::vector<size...
[1 reply] : > col_ind=object.col_ind_; 1. Make your member variables private, so y... (by salem c)
A5 / 2
 
Where can I find realization of A5 / 2. All I have is below. But as I understand it is A5/1: #...
[1 reply] : https://cryptome.org/gsm-a512.htm It doesn't appear to have an auspic... (by lastchance)
best way to define/declare global data
 
Hi all - I'm maintaining a C program (have added some C++ to it). One source file defines an arra...
[2 replies] Last: That is what a header file is for: globals.hpp #ifndef GLOBALS_HPP ... (by Duthomhas)
Can someone explain how the output is what it is?
 
So I have the this code: #include<iostream>​ using namespace std;​ void fun(int x) {​ if...
[3 replies] Last: Add print statements and you will see it. #include<iostream> using... (by jonnin)
How do you come to the output?
 
Code: void createList(node*& head)​ {​ for (int i = 5; i < 20; i++)​ {​ bool co...
[1 reply] : It gets the prime numbers between 5 and 20 and sequentially prepends t... (by helios)
New to C++ could use some help
 
How do businesses like Amazon™ calculate shipping? The cost of shipping can include the size and w...
[3 replies] Last: thank you for the link on how to use code tags, sorry about not using ... (by closed account iN72160M)
Question about linked lists
 
Lets say I have a linked list with a struct defined like this. struct LList{ int data; struct...
[3 replies] Last: I got nothing on how that could be happening. (by jonnin)
help with cin lines in switch statement
 
Can anyone help and explain to me how to correctly include cin lines? My current code does not have ...
[13 replies] Last: @seeplus Thank you so much! I see what I was missing. Your help is ve... (by closed account 9G8M4G1T)
by Qsh222
C++: Find the XOR of a closed interval of the array
 
I've worked out a solution, but it's not efficient. Could someone optimize my solution, using prefix...
[1 reply] : #include <iostream> using namespace std; int main() { int n, m; ... (by lastchance)
Every 11 years, add certain amount
 
I'm stuck on this part of my homework. Everything else works, except for one function. I need to add...
[4 replies] Last: fucking life saver. Thanks a lot. (by zer0Cool)
by Qsh222
How to calculate XOR on a given interval of numbers
 
For example, you're given the interval 5 15 17 90. How to calculate the XOR of it?
[4 replies] Last: OP probably meant "sequence", not "interval". (by helios)
September 2021 Pages: 123... 6
  Archived months: [aug2021] [oct2021]

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