Beginners - October 2021 (Page 6)

How to create a Save/Load function for a text based game
 
Hi I just recently started learning c++ at the beginning of my college semester a couple months ago, and I liked it enough to attempt a text based game. It's go...
[2 replies] Last: you have to save your rooms if they change, eg if room 3 has a pile of... (by jonnin)
by jo8et
C++ libraries...!
 
Hi all, I am just starting out using external libraries. I can compile and link the below code, for example. And I can produce and use library no problem ...
[7 replies] Last: C++ already has regex, no need to use the boost one. According to th... (by thmm)
How to print an std::vector in a file: error
 
I have the following vector that represents my time iterations in the code that I would like to print in a text file for documentation/debugging purposes. ...
[11 replies] Last: @Furry Guy I see, but it's a bit complicated. I am sort of benchmarkin... (by JamieAl)
Showing the ranks of certain elements in an array.
 
This program is a quiz with all the answers in a key array. The user inputs answers in answer array. It then checks to see if at least 15 were correct. I've ...
[3 replies] Last: Efficiency aside, your design is difficult to implement without a var... (by jonnin)
Arrays are not them...
 
So our teacher asked us to do 2x2 matrix. This is my code for its interface. However, arrays mat1 and mat1 are always equal. Whenever user input a value on...
[7 replies] Last: #include <iostream> using namespace std; void Matrix3x3(int mat1 )... (by seeplus)
while loop won't print file content in the console
 
Hello, as I'm sure you'll be able to tell by how strangely organized my program looks I'm a new C++ learner. Recently I've been messing around with fstream, a...
[5 replies] Last: https://www.cplusplus.com/reference/ostream/basic_ostream/tellp/ Use t... (by salem c)
Converting cents to dollar with $D.CC form where dollar can have many columns but cents have to have 2
 
I'm trying to get the the dollar to say $D.CC. On my code when you put 8 quarters, 2 dimes, 0 nickels, 0 pennies you get get $2.2 but I want it to say $2.20. It...
[4 replies] Last: the formatters stick until you change one, don't need to repeat them. ... (by jonnin)
C:\Users\admin\Desktop\C++\collect2.exe [Error] ld returned 1 exit status
 
Good evening! the error named"Id return exit status" keeps on showing. I don't know why SOURCE CODE: #include <iostream> using namespace std; const do...
[3 replies] Last: thank you so much for helping me. I will remember to double-check so t... (by beginnerzzzzz)
by jo8et
Insert variable directly into string
 
Hi all, I was wondering what the C++ equivalent of the below Python code would be? ht = 10 e = 'FT{}\r\n'.format (ht) ie, if you wanted to in...
[5 replies] Last: Thank you (by jo8et)
how to move a decimal
 
I'm having a little bit of a hard time figuring out how to move a decimal to the left. I understand I could divide or multiply, but that is not what I want to d...
[11 replies] Last: [quote=PhoenixS2020]I understand I could divide or multiply, but that ... (by lastchance)
by lmwbxr
Do While Error
 
Hi, I am new here. I am not looking for this to be solved for me but for a suggestion of how to fix this :-) -- I took a for loop problem, and tried to convert...
[13 replies] Last: Are you sure about L38 in your update post??? (by seeplus)
Can someone help me spot the error?
 
below program should display. The sum of 2 through 5 is 14 ( 2 + 3 + 4 + 5) #include <iostream> using namespace std; int main () { int next ...
[5 replies] Last: From your code ; initialise sum to 0; ------ [line 8] the statements i... (by Daathwi)
fatal error: conio.h: No such file or directory
 
Im trying to run this code but I get this error! fatal error: conio.h: No such file or directory #include <conio.h> #include <stdio.h> void...
[5 replies] Last: [quote=TeleMark]main idea in my question is is to solve the conio.h he... (by lastchance)
by Naqq
Asking a User for Addresses in Arrays
 
I am trying to create an array called block that holds 3 addresses. I need to ask the user for the three addresses. Would I need an enum class before the stru...
[17 replies] Last: L72 Address should be address! Also you can just do for L71/72 : a... (by seeplus)
search through array of objects
 
Hey all, working on an assignment. I'm trying to have the user search for a book by title out of the ones given and then having it display its info. could anyo...
[8 replies] Last: Perhaps something like: include <iostream> #include <iomanip> #incl... (by seeplus)
by A man
Outputting multiple lines in file.
 
write_account() should input those lines in "account.dat" file when accessing create_account() in class account. I want to simply input multiple arguments of cr...
[1 reply] : L101. You can't test if an error occurred after you have closed the fi... (by seeplus)
Problem in calculation?
 
I'm trying to figure out why, when i run the program and put in the numbers, the calculation only shows numbers untill 99. There after it will produce numbers l...
[2 replies] Last: Got it, thanksss. (by mark12345)
functions
 
Hi I am new to cs and currently learning to use c++ this was an exercise we had in class the other day. I want to use ifstream to get data from a text file but ...
[9 replies] Last: See also http://www.cplusplus.com/forum/general/280282/ (by seeplus)
Replace Pixels from a bmp into another bmp file.
 
Hey i have to copy the pixels from this bmp¹ file ( https://imgur.com/la1frjx ) into this bmp² file ( https://imgur.com/iwNqkfG ). I got it to read the header...
[2 replies] Last: http://easybmp.sourceforge.net/ Unless the whole point is to learn ho... (by Duthomhas)
bottom up heap construction
 
If we have word "banana" and we want to use bottom up heap construction for sorting , the parent in each node will be greater than or equal to the both child, b...
[1 reply] : I'm not sure I understand your question. - Are you asking why the hep ... (by AbstractionAnon)
October 2021 Pages: 1... 4567
  Archived months: [sep2021] [nov2021]

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