Beginners - June 2020 (Page 11)

Counting vowels from input stream
 
Hi, trying to write a helper function to count the amount of each vowel present in a given text file. This is a textbook exercise, not homework; just trying to...
[4 replies] Last: Yep, I tried adding ch = tolower(ch); and that did the trick! Thank... (by dakotad8218)
main menu and sub menu
 
Hey. I'm trying to have two menu's in this program,a main menu and multiple sub menu's.. but the thing is i'm trying to fit in a "return to the main menu" optio...
[6 replies] Last: Hello FoaaD2506, Going over your program. Some things I have changed:... (by Handy Andy)
Cards Decks and classes
 
I am struggling with getting my playing cards classes to work as I would like. I can create 52 cards and then put them into a deck, shuffle the deck. However I ...
[9 replies] Last: @jamesfarrow I see you have addopted 2 approaches in your code, one fr... (by malibor)
Infinite loop
 
I want to get an user input as age and add 100 to it and print out how old they will be every year. My code below does this, but is an infinite loop and does no...
[6 replies] Last: ^^^ Note that any loop can do anything. Its the one that is most rea... (by jonnin)
How do I update the data without using void/struct
 
Im having problem on how to update the data in .txt file without using void() from the beginning. Just need a simple code is enough.
[3 replies] Last: The thing that's hard to understand about files is that when you want ... (by dhayden)
print function for array
 
hello,I have this program which reads elements from the user for an array of . and i made functions to enter elements and find max and find min element. i'm t...
[8 replies] Last: oh it was that easy lol i'm sorry, i was having an error about calling... (by FoaaD2506)
To Write data in a spectic format
 
Hello guys am working on a c++ project that search for Student id in the source file,if a match is found it writes to the output file after the search those we...
[4 replies] Last: Thanks Andy...........i will research more on std::setw() it might wo... (by Magplusplus)
Bubble Sort
 
Hi all! I'm working on a project with a couple of my buddies. We are almost done with the code for our project. However, we noticed that there is a problem with...
[2 replies] Last: Andy's right. Your bubble sort needs to be something like this: enu... (by dutch)
Stuck at do while loop
 
I am currently having trouble on doing the do while loop. I am not sure why since I have been following the tutorial. I have manage to loop the menu b4 the sw...
[9 replies] Last: Hello rhap123, Watch your indenting it is terrible. do { std::... (by Handy Andy)
C++ Algorithm to Copy a BST (except the largest data-member) Recursively
 
I am trying to figure out a bunch of practice problems involving Binary Search Trees and recursion. A lot of them are like "Copy an entire BST except..." and th...
[5 replies] Last: Thank you for the assistance. I ended up going with a less efficient s... (by confundido)
cin to read end of file char
 
As I am going through Programming Principels and Practices using C++, it says for a string, >>reads whitespace-separated words. ....terminate the loop by giving...
[2 replies] Last: @jlb, you've got that backwrds. Nix is Ctrl-D, Windows is Ctrl-Z. The... (by dutch)
by medosz
prime numbers 1-100
 
I am trying to write a program to print the prime numbers between 1 and 100. Obviusly I am trying with the wrong logic but I can not find the way to fix it. Cou...
[6 replies] Last: Something like this would be best done using templates and recursive ... (by jonnin)
Send array of char to a function
 
Hello, what is the difference between these? (W and &W in line 15) When I use &W output is wrong. Thanks #include <iostream> #include <string> using name...
[1 reply] : Well Palindrome(W); is the same as Palindrome(&W ); In the forme... (by salem c)
OR not working with char
 
Write your question here. when i try to put or in between characters the whole while statement doesn't work.. why? what do i have to change ? while(choic...
[4 replies] Last: thank you (by FoaaD2506)
Confusion in a question!
 
I am not getting the third point. 3. The resistance of each of the wires 2 through n – 1. Should I just take resistance from the user because I am not getti...
[9 replies] Last: The 'loop law' is Kirchoff's Second Law and refers to voltages around ... (by againtry)
by mnnsa
reading file line by line
 
my code is not able to read files line by line , i am not bale to figure out whats wrong pls help #include <iostream> #include <iomanip> #include <fst...
[13 replies] Last: Hello mnnsa, My question would be. Do you need to get the file names ... (by Handy Andy)
by Tomi
Problem with image drawing
 
Hello! I try to draw a .BMP image in my code, but something is wrong with it: although the program itself can run, but it doesn't draw the image. (I wrote com...
[8 replies] Last: > "not declared in this scope" This is not a linker error. Did you #... (by mbozzi)
by rock33
undefined reference to with constructor
 
Hi Community, i try make a disjointsets with rank, when i compile the files, i have this error: main.cpp:6: undefined reference to `disjointset::disjoint...
[3 replies] Last: What's the problem? (by MikeyBoy)
verify input data
 
hello everyone, I have a problem with a program I am trying to do in c ++ with visual studio 2019. I have an int input variable that must be a number to m...
[5 replies] Last: Hello espcplusplus, I can only comment on the code that you post. Whe... (by Handy Andy)
by medosz
yes or no option in the loop
 
This is a simple guess the number program. I am trying to put an option that asks the user "Would you like to play again? (y or n). If the user press the y it s...
[1 reply] : return in main ends the program. it that is a zero, it is normal exec... (by jonnin)
June 2020 Pages: 1... 9101112
  Archived months: [may2020] [jul2020]

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