General C++ Programming - September 2021 (Page 3)

The understanding of the code. C++
Can you explain me please this code? I understand it in general terms. I need a clear understanding. #define isEven(x) ((x & 0x01) == 0) #define isOdd(x)...
[14 replies] Last: Can it be true? You are just using (the results for) the standard E... (by lastchance)
by Maln18
Help me with this C++ code
I have to do this. These are the instructions. Write a program that queries the user for an odd integer n, where n is a 3, a 5, or a 7. Create a 7x7 static ma...
[6 replies] Last: the only issue i have with that code is if i enter a magic square nu... (by seeplus)
Help me fix my code.
EDIT: This was Maln18 's unnecessary thread originally - he/she is not worth replying to. This is your THIRD thread with precisely the same problem! For g...
[2 replies] Last: [quote=lastchance]For goodness' sake stop cross-posting. Well, the th... (by George P)
C++ App error .dll not found
I am new to C++ programming and I am using Visual Studio 2019 I have a project that uses a dll xerces-c_2_1_0.dll. This dll is in the same directory as the ap...
[6 replies] Last: strange. if you built it on 2 different computers, you can compare th... (by jonnin)
by gadi01
call derived member functions (1,2)
I define a function in base class as virtual and I redefine it in the derived class. When I call this function in func.cpp to use its members, the call fails. I...
[38 replies] Last: This page has a fully worked cpp example. (by TheIdeasMan)
by shader
Kth stack permutation
A stack permutation of number N is defined as the number of sequences which you can print by doing the following Keep two stacks say A and B. Push numbers f...
[1 reply] : A guess: (by keskiverto)
by Denvor
Linked list with templates
can someone please help me with this program?Im so confused i dont even know where to start. My program is a bit complicated.Im suppose to create two classes.Th...
[3 replies] Last: You'll find things easier when you come to code the list if you have: ... (by seeplus)
by Qsh222
Find the first n prime numbers using the sieve of erathostenes
The program is supposed to display the first n prime numbers, where n is inputted by the user. I only managed to work out a really slow solution. Could someone ...
[2 replies] Last: Use the prime number theorem to generate an upper bound on the nth pri... (by JLBorges)
Why am I getting inf for my output?
[5 replies] Last: Perhaps: #include <iostream> #include <cmath> using namespace std; ... (by seeplus)
by Qsh222
GCD of n numbers
The program is supposed to display the GCD of n numbers. I managed to work out the solution, but in only gets 96 / 100 points. Could someone help my oplimize th...
[5 replies] Last: Nothing wrong with your solution. Points off for: Dinking with std::c... (by Duthomhas)
Word Count
Can someone help me derive a program or to understand how to create a program that counts words? That would be helpful!!! Especially utilizing no vectors onl...
[17 replies] Last: You got a problem with the venerable "goes to" operator? (by Duthomhas)
by Armanc
How to find all possible placements in a stack with using recursive function
I am trying to code a program that finds a target number by using six other integers and four mathematical operations (+, -, *, /). I do not want to use any kin...
[3 replies] Last: it is perfectly *safe* to add () to RPN with a dumb algorithm that put... (by jonnin)
Finding discount
#include <iostream> using namespace std; int main() { int quantity; int price; cout<<"Enter the quantity:"; cin>>qunatity; cou...
[3 replies] Last: int is for integers 90 is an integer literal operations between in... (by ne555)
Anyone can help me fix my code?
The matrix is being allocated on the heap as it is defined as static. To allocate on the stack, don't define as static: #include <iostream> using std::cin; ...
[no replies]
Compatible C++ libraries Questions.
I am trying to construct a cross compatible C++ Libraries platform, and I was wondering if anyone can reply with a set of answers and recommendations. I wish t...
[9 replies] Last: I am trying to assemble a native C++ library set where types immediat... (by helios)
by Cplusc
how to find common elements between different matrices
I have 3 matrices. I want to find the shared elements within these matrices with the number of repetition. matrix 1: 1 2 3 4 5 3 2 1 3 2 1 0 0 2 1 4 mat...
[4 replies] Last: what is a point, in the above? matrix 1,2,3 all ? I think you need a... (by jonnin)
C++ Programming Code This
Hello can anyone help me figure out this C++ programs I don't understand how to do it can anyone program it for me and use comments? Static arrays or static ma...
[5 replies] Last: Something like this: #include <iostream> #include <string> #include... (by seeplus)
by volang
winsock getaddrinfo
Hello. Hope everything is alright! I have a question about winsock getaddrinfo(domain_addr, "43", &hints, &result); After a call to that function, the las...
[2 replies] Last: thanks man! freeaddrinfo() <--- (by volang)
I am getting an error for no reason
It is saying "Member declaration not found" in Word.cpp, "undefined reference to `WinMain@16'" in Word, and "recipe for target 'Word' failed" in makefile. But ...
[4 replies] Last: The Word::getWord() declared in Word.h is const, but the one defined i... (by helios)
Help with a C++ Project
Hi! I am trying to figure out this problem. Write a program that asks a doctor to enter the number of patients that walked into his/her clinic at the end of t...
[1 reply] : You've made a start, that;s good. You need to ask for the number of p... (by kbw)
September 2021 Pages: 123456
  Archived months: [aug2021] [oct2021]

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