Beginners - July 2022 (Page 3)

Make output file clear itself everytime program is rerun
 
Hi all, I am making a game where each player will pick a card and then see who wins, then this repeats for 5 rounds ... and they can choose whether to continue ...
[3 replies] Last: for it to clear previous output content when the program is terminate... (by seeplus)
Use OpenCV only for template classes?
 
I just wanted to hear an opinion on this. Do you think it is fine to use OpenCV in a project for the SOLE purpose of using its template classes? I have gotte...
[1 reply] : > using OpenCV in a project to only use the template classes is approp... (by JLBorges)
by Lmac
for loops and break statements
 
Write your question here. for this project im having a hard time on which mistakes im doing for the loops and break statements too for this project. #include ...
[5 replies] Last: [quote=Lmac]I am a new programmer Spending some time poking around Le... (by deleted account xyzzy)
by shenef
Need help reading in a CSTRING and returning a single CHAR from the input
 
Hello everyone, I am trying to implement a menu-driven program using C strings. i.e char array What I want to do is allow the user to type the full name of t...
[5 replies] Last: kbw -- I would prefer to use the string class honestly, but for this p... (by shenef)
What am I missing here?
 
Hi everyone! I'm a little confused here as basically when i run the code bellow with len1 being longer than len2 the if(len1 << len2) still executes. I have deb...
[3 replies] Last: Also, it arguably reads better if you remove the unnecessary block & i... (by Ganado)
Programming Challenge
 
i need to complete to code output should read This program will compute patient hospital charges. Enter I for in-patient or O for out-patient: O Lab f...
[4 replies] Last: Thank you (by bsauceda03)
by Geckoo
Import BMP
 
Hello everyone. I have this header in my project - always my tiny 2d engine. I would like to import some simple BMP pictures in my projects. So this code reads ...
[6 replies] Last: Thank you everyone for your comments. Thank you salem c for your cleve... (by Geckoo)
Using type declared in template class
 
Hi This code: // Online C++ compiler to run C++ program online #include <iostream> template <typename T> class Test { public: using...
[2 replies] Last: thanks (by rozick1)
Converting a string to multiple integers
 
I am trying to take an input formatted like 11-5-2008, 01-01-2020 or 1-1-2020 and turn that into three integer values, one for the day, month and year. I am tr...
[10 replies] Last: Yes - much better. I was in a hurry and just did some copy/pasting wit... (by seeplus)
by Mjn4
Make text emoticons readable for the computer
 
Hello, I am currently working on Visual Studio Code and I was looking for an extension that allows ascii/text emoticon snippets to be readable for the comput...
[4 replies] Last: Heh, it is easier than you think, but you have to jump the right hoops... (by Duthomhas)
header files and hierarchy
 
Hi! Let's say i have 3 programs: main.cc a.cpp a.h b.cpp b.h main.cc uses a.cpp functions and a.cpp uses b.cpp functions. so it is clear hierarchy....
[3 replies] Last: You don't have 3 programs, you have 3 source files, AKA translation un... (by deleted account xyzzy)
C++ pointers (1,2)
 
Hello, my professor gave me this code and asked me to run it, but before that she said that I must remove all the asterisks in the codes and instruct me to use ...
[31 replies] Last: I suppose one could contend that short of a hardware failure, no memor... (by JLBorges)
Repetition of output in a text file.
 
So, I wanted to do some practice around fstream, and I decided to make a sort of database where data regarding voters read from a txt file is sorted into two fi...
[2 replies] Last: Do you mean something like this: #include <iostream> #include <fstr... (by seeplus)
by Mjn4
iteration within an if statement with a string variable
 
Hello, unlike while statements, if statements allow several answers to have a character output stream, but without iteration. Here, I have a string variable...
[5 replies] Last: One thing to note about string matching, the case of the letters matte... (by deleted account xyzzy)
classes referencing each other
 
hi, I am transitioning from python to cpp, and I was learning some of the design patterns. The code bellow is from https://refactoring.guru/design-patterns/s...
[3 replies] Last: cool, Sure, I use headers and source files in all my projects. But was... (by rudiHammad)
Fault in execution of the below given code
 
Can someone help me with this? Apparently, my first length function loop is running infinitely but I'm not able to understand the fault (that's what I understoo...
[5 replies] Last: its worth your time to write an integer power function anyway, both in... (by jonnin)
by Andy99
Loop switch statement
 
How to loop this switch statement? Please check my code The program will calculate the bill amount for each customer and prints the bill. The process will cont...
[3 replies] Last: some totally unrelated tips... variables are your friend. Magic numb... (by jonnin)
Weird alignment issues in output?
 
Does anyone know why must the 4th item's line be out of the alignment to make the output be nicely aligned ? If I made the word "Attack" be nicely aligned as 1...
[2 replies] Last: Ohh wow, thanks for pointing this space or tabs thing out... I cut the... (by sandbox007)
I dont have any idea why this code isnt letting me input. Sorry for being totally naive as a beginner but pls help.
 
I have just made a simple code to taken in some inputs (as testcases and values), but this code is just running and completing execution on both codeblocks and ...
[6 replies] Last: Being a newbie is totally fine, but I would recommend to learn the bas... (by thmm)
Storing Items In an Array of Custom Lists
 
I'm working with code that implements its own templated CusList data structure (a variant of linked list) that is dynamically allocated. CusList contains addi...
[10 replies] Last: [quote=ElusiveTau]I'm a little confused because others seem to think i... (by mbozzi)
July 2022 Pages: 12345
  Archived months: [jun2022] [aug2022]

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