Beginners - March 2020 (Page 9)

Season Program?
 
Hi, new here, I'm in about week 3 of my C++ class and I and we are on the decisions chapter (if, else, switch, etc.) I was given a psuedocode algorithm to base...
[3 replies] Last: I had myself thinking I was nuts and it was all just a syntax typo. ... (by jlb)
How do I extract specific words from a string in a text file?
 
my assignment is to take a string from a text file and count the number of words in it. I've gotten that far but now we have to be able to take a certain number...
[2 replies] Last: #include <iostream> #include <fstream> #include <string> using names... (by Manga)
by LuffyD
Reading from a txt file
 
Hello, I need to read from a txt file, skipping the first 4 lines, and then read the data after that 4 lines. I want to save that data into a dynamic array us...
[5 replies] Last: Hello LuffyD, In addition to what salem c has said and your last po... (by Handy Andy)
Hollow rectangle, with X at its center whenever the entered values are both ODD numbers..
 
#include<iostream> using namespace std; int main() { int length=0, width=0, cwidth = width/2, clength = length/2; cout<<"Th...
[2 replies] Last: Also here https://www.cplusplus.com/forum/general/268749/ Spamming th... (by salem c)
by kem
Can you help me convert this for c++17?
 
Hi guys This code is deprecated, I would like to convert it for C++17 If I understand correctly I should use a lambda instead of bind2nd, it should be prett...
[1 reply] : Nevermind stable_partition(_deck.begin(), _deck.end(), (const CardS... (by kem)
Basic insertion in vector: why this insertion doesn't work?
 
hello, If I want to insert a value given a certain index, sorry can you tell me what I am missing here. Reading the documentation I was under the impression tha...
[4 replies] Last: You're using the wrong proto. The one you use here is to insert multip... (by Zaap)
Combat Game (1,2)
 
Hi everyone, So I'm currently taking a class for programming and can't figure out how to solve one of the assignments. Note that all five downloads are together...
[20 replies] Last: It's alright! I ended up figuring it out :) (by TRONIIX)
by asxxx
Game library
 
Hello. I want to create sudoku game. I am thinking which game library choose. Maybe Allegro? Anyone know good book/course about creating games in Allegro ? Than...
[3 replies] Last: The easiest thing to do is to break the 9x9 array into a 3x3 array of ... (by AbstractionAnon)
Troubles with extracting data
 
So I have a program that has to calculate the coefficients of this formula (ax+by)^n using Pascal's triangle, but I have some troubles with getting data from fi...
[7 replies] Last: Hello Handy Andy, I read your reply and realized some big mistakes, es... (by electro amperkin)
by Vind34
Can anybody help me to solve this error...
 
I want to delete function.... can anybody help me??? case 4 is the one where got error.. im still an amateur, just started to learn coding... Put #include ...
[7 replies] Last: Split your code into functions to find the errors. I wasn’t so patie... (by Enoizat)
by Bopaki
My delete node function does not delete the node in the linked list
 
This code does not delete the node as required. void removeElement(int remValue) {// to remove an element, we go through the list, find the value given...
[2 replies] Last: { // found match cout << "Deleting: " << current << "\n"... (by keskiverto)
Matrix Addition (1,2)
 
So I have a question that I can't figure out involving matrices. It goes as follows: Complete the implementations for the class Matrix in the file Matrix.c...
[30 replies] Last: NEVERMIND! I JUST REALIZED WHAT YOU MEANT! YOU ARE A GEM!!!!! THANK YO... (by TRONIIX)
Compile errors
 
Hello everyone, I have the source code for this program I'm trying to compile but I'm receiving many errors at this point idk where to start except the first er...
[7 replies] Last: Hey Andy let me know once you've tested it in your IDE (by itachix)
Graphing in the console
 
I don't know what the error in the sine wave and the quadratic are. It keeps returning 0xC0000005... What does this mean? /* sin example */ #include <s...
[5 replies] Last: if( f(x) > max_allowed) Y = (max_allowed) else Y = f(x); if (f(x) < 0)... (by jonnin)
Finding letters in a sentence
 
Hey guys, so my task is to find all the letters in a sentence or sentences. My sentences are : " Siandien sviecia saule. Rytoj tikriausia lis lietus. " Howeve...
[1 reply] : I do not see your bug. I suspect it is where you use find, but that... (by jonnin)
Is this pointer dangling pointer at the end of the program?
 
My question is simple, is the pointer at the end of this array a dangling? (after all the deallocation is performed) #include<iostream> using namespac...
[2 replies] Last: It looks like you've cleaned up properly. But, yes, arr is "dangling" ... (by dutch)
Input Validation in C++
 
I am new in C++ and I have an assignment to make a calculator. My teacher wants to have a validation every time that the user entered wrong. For example, it ask...
[1 reply] : #include <iostream> #include <cctype> int get_int( const char* prom... (by JLBorges)
urgent
 
hi, please, I need someone to help me code with this. in a field there are four animals - a dog, a mongoose, a snake and a mouse. dogs kill mongoose, mongoose k...
[4 replies] Last: Assuming all animals : - run in straight lines; - have sufficient trig... (by lastchance)
by defs
boolean and return
 
class Triangle { public: bool Set(double aa, double bb , double cc ); private: double a; double b; double c; }; bool Triangle::Set( double aa,...
[3 replies] Last: Thank you Andy and Zaap. I did edited code and i did understand that... (by defs)
For range loop question
 
Halo i am wondering about the For range loop with a class. it a little bit confused me.. bool Movies::increment_watched(std::string name){ for...
[3 replies] Last: 1) m is a Movie here. No constructor is called, it's exactly the same ... (by Zaap)
March 2020 Pages: 1... 7891011... 14
  Archived months: [feb2020] [apr2020]

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