Beginners - March 2021 (Page 7)

by dede67
please correct
 
I can't seem to solve this code problem of shuffling football team together wat did i do wrong. it saying, expected unqualified-id before 'for' #include <io...
[3 replies] Last: Thanks so much seeplus and salem c. much appreciated (by dede67)
by bstroe
Average word length
 
How to find the average word lengths without taking into account the spaces? int is_letter(char c) { if (('a' <= c && c <= 'z') || ('A' <= c && ...
[5 replies] Last: #include <iostream> #include <iomanip> #include <cctype> using namesp... (by lastchance)
In design phase. Is this layout/syntax correct? (1,2)
 
My question is about the code posted below. As stated in the title, I'm in the design phase for this part of a program. I have never used "continue;" before. ...
[27 replies] Last: I have made both changes. The only change I would have made was whe... (by Brian845)
dynamic memory allocation inside class
 
Hi guys, trying to do some dynamic memory allocation inside a class but visual studio red underlines the 1300 in Sales john(1300, "John"); #include <iost...
[4 replies] Last: There's no need to use strcpy_s here as the allocated buffer is the co... (by seeplus)
vowels using find_first_of()
 
Using the function find_first_of(), I want to make a program that would count the number of vowels of an inputted string. For example, an input of "hello world"...
[2 replies] Last: #include <iostream> #include <string> #include <cctype> int main() ... (by seeplus)
acronyms using find()
 
Using the find() function, how do I find the acronym of an inputted string? The program would find the first letter of each string, put all leading letters in o...
[3 replies] Last: Using stringstream: #include <iostream> #include <string> #include ... (by seeplus)
Visual studio / c++17 question?
 
Hi, I dont have a problem, but I am self learning so I dont really have anywhere else to ask these question, so hoping someone could help me out. I am learni...
[7 replies] Last: @DonnaPin, I am sorry. You are right, I just forgot that insert retur... (by thmm)
Menu program not exiting right
 
I was trying to re-arrange my code to make all my functions void and make int main call them but ran into a problem. First, I know global variables are frowned ...
[2 replies] Last: Thank you! I realized that almost 5 minutes later (by av16352)
Return value from void into array
 
Good day everyone. I need a help for my assignment I have this code and the output it shows the d2, m2, and y2. void addDays(int d1, int m1, int y1, int ...
[2 replies] Last: Basically, i confused what supposed to do. The solution that I mention... (by mechatronicb)
by joe100
Using values in multiple functions
 
I am trying to put a value from one function into another function but I have not found anything explaining how to do that for my situation. I am trying to get ...
[4 replies] Last: salem c Thank you! That is what I wanted to do just wasn't sure how to... (by joe100)
by moctar
Binary divisibility
 
is there any ways to check binary divisibility without using modulo like (p%5==0) but rather using decrease and conquer algorithm. i already now that to chec...
[6 replies] Last: yes i am allowed to use division but not modulo, as i have mentionned ... (by moctar)
Why does my pop function in my .cpp file not erase the last element from my stack?
 
I updated the post, please scroll down and check out my issue. Help is very much appreciated. Below is the .cpp, main and .h
[5 replies] Last: void EvenStack::pop() { while (!myStack.empty () ) //¿? { st... (by ne555)
Need help with assignment
 
I have a homework assignment but need help with it. It goes Ask the user for his/her weight (in pounds) on Earth Ask the user for the name of a celestial body...
[14 replies] Last: Any time. Glad it helped. Andy (by Handy Andy)
Basic Functions
 
The question is : Create a functions which: sum two integers (when x>=y)or calculate a*b(x<y) - find maximum value of 2 integers what should i do here? sorry...
[3 replies] Last: int sum_pr(int x, int y) { return x >= y ? x + y : x * y; } fin... (by seeplus)
by thmm
Preprocessor
 
What does this directive do? I saw this somewhere #if 0 // some code #endif
[8 replies] Last: Thanks everyone, now it's totally clear. (by thmm)
by chipp
namespace syntax
 
so i found iostream source code in this web: https://code.woboq.org/gcc/libstdc++-v3/include/std/iostream.html been curious abt namespace syntax, how coul...
[7 replies] Last: Oh you're right, it is a different order than the standard attributes. (by Ganado)
I'm New
 
Hello guys! I'm sure you get this a lot in the forum but I'm a few months into learning C++ and coding in general and I seem to like it a lot. I was wondering w...
[2 replies] Last: When learning to program you can follow this pattern while wanting to... (by thmm)
Need help!
 
I need to have attack skill be used for the Sword and Nunchuck attack function that is overriding the weapon virtual function. I can't figure it out. The equati...
[1 reply] : When compiling it has the following errors/warning: In member functio... (by coder777)
by samj
Change in bool value seems to be not applied to while loop condition
 
Hello All, Hope you are doing well. I am a begineer in C++ and this is my first post here. I wrote a code where the user is asked to enter their name. If the ...
[9 replies] Last: Thank you! (by samj)
by moctar
matrix inverse
 
i am trying to write a program to get the inverse of any type of square matrix using strassen based matrix inversion. but what i don't understand is how to re...
[6 replies] Last: Thank you! i will have a look into it. (by moctar)
March 2021 Pages: 1... 56789... 13
  Archived months: [feb2021] [apr2021]

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