Beginners - October 2021 (Page 3)

How to add simulator
[3 replies] Last: This is a problem of windows. min/max are defined as a macros. So dire... (by coder777)
>> operator not working for ifstream
So I have this function I'm working and I've been stuck on it for hours, in short I'm trying to import a file and add it contents to a vector but when ever I t...
[2 replies] Last: Consider this: template< typename V, typename W > void Digraph<V, W>::... (by coder777)
Out of range error on substr
Error: terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr: __pos (which is 2) > this->size() (which is 0) Aborte...
[3 replies] Last: Ganado -> Hey thanks for the tip, the ignore placement seems to have g... (by Volapiik)
Blackjack: Issues with repeating integers in array (1,2)
I've been making a blackjack program to refamiliarize myself with the C++ programming language; I have learnt up to reading and writing from a file, but it's be...
[22 replies] Last: A std::deque might be better suited for a deck of cards than a std::ve... (by George P)
Sorting a List With Nodes
Hello All, I am working on a small program for classes in C++. For the program, we have to write a program that creates a sorted linked list from a data file...
[5 replies] Last: bool node::operator > (const node& n) { return n < *this; } but eve... (by ne555)
changed address of variable in the heap segement
#include<bits/stdc++.h> using namespace std; int* A( ){ int* a = new int; *a = 3; cout<<a; return a; } int main( ){ A( ); ...
[1 reply] : why does the address of a changed? Because each time you call A() ne... (by coder777)
Program Eror!
I have this error in visual studio, and i dont know what does mean Link for picture for the error #include <ostream> #include <string...
[1 reply] : This is your friend declaration: friend std::ostream & operator<<(std... (by Ganado)
by Milnk
Convert numbers into letters and multiply the number by itself
If I Input 8 5 12 12 15 23 15 18 12 4 It should Output helloworld 8:8-16-24-32-40-48-56-64 5:5-10-15-20-25 12:12-24-36-48-60-72-84-96-108-120-132-144 ...
[6 replies] Last: @kazeroth900, Your "secretCode" doesn't make much sense. Most codes a... (by lastchance)
by Jhokuu
Cleaning up output text in proper columns
I was wondering how to square up columns so my output looks cleaner instead of it being jumbled like it kind of it now due to the different legnth of names. .t...
[4 replies] Last: Simply, L14 you need setw() for name like you have for the other fiel... (by seeplus)
C++ Output 3 letter word forward/backward
Hello all. Back yet again with another brain puzzler. I'm having trouble with another playaround program, searched before posting, and cant find anything that...
[4 replies] Last: C++11 introduced the range-based for loop. C++20 allows the range-bas... (by George P)
by hasane
How do I check for correct GUID from .txt file?
I have a GUID list in .txt file like this {4120cb22-c194-41bf-a221-49b0952e349e} {83cc03cc-80d7-48ac-8dd1-051ce9cf2609} {8448d87b-bf75-439d-be33-93070a19cc77...
[3 replies] Last: Contains would be welcome, that was a big miss. Ive been using strstr... (by jonnin)
How would I order the names alphabetically?
You're supposed to be able to enter the amount of classmates (in the first line) and then write their names (e.g. 4 and Alex, Bones, Charles). Everything works ...
[2 replies] Last: Perhaps: #include <iostream> #include <string> #include <algorithm>... (by seeplus)
Sorting total and average score of the students and their ranks in ascending order
Hello! The code below is horrible. I know that. But it's just my assignment and here is the help I seek: The code itself should open a text file with 15 stude...
[5 replies] Last: Despite that and the fact that the code is C rather than C++ ... lets ... (by keskiverto)
Error when using file handling in C++ project
I just learned file handling and now developing a restaurant management system with 2 different credentials(staff and admin) in c++. I keep facing 2 problems in...
[1 reply] : For deleteStaffByUsername: You open a file for reading called database... (by Ganado)
Recipe for target failed. Error
Aahhhhh! Tried compiling this class and the error "Recipe for target 'Calculator.hpp' failed." popped up. It showed a too and it was red on the las...
[4 replies] Last: His account now has limited functionality...probable due to posting ju... (by The Grey Wolf)
Decimal Division function
Hi, I need some help with my Calculator class' function. I have it to add, subtract, multiply, and divide. I need a decimal divisor script! How do I make it div...
[2 replies] Last: @lastchance Thanks for the fast response! Will try! (by OcoIncs)
Pyramid pattern based on NUMBER OF STARS
* ** *** **** ***** I have an idea how to do it based on numer of rows, but i dont know how to do it when I can only input number of stars.
[12 replies] Last: [quote=dio123321]print this pyramid reverse? What is that supposed ... (by lastchance)
Alternatives for "using"
I was wondering if there are any alternatives for "using"? #include <iostream> #include <fstream> #include <iomanip> #include <ctime> #include <vector> ...
[6 replies] Last: LOL (by againtry)
Is there any Alternate of <dos.h> ?
//to use 'getdate' & 'delay' we include #include <dos.h> As we know there is no dos.h header file in UNIX, am working in Xcode is there any alternate to do t...
[4 replies] Last: uh, you have to include the required headers for stuff. If you want to... (by Duthomhas)
C-string not accepting new input within switch case?
Hi, so I've spent hours pouring over different forums and documentation and I cannot for the life of me figure out why during case 'D' it doesn't accept new inp...
[2 replies] Last: Salem, thank you so much. I feel really dumb. I knew about that too. I... (by mresli99)
October 2021 Pages: 12345... 7
  Archived months: [sep2021] [nov2021]

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