Beginners - April 2022 (Page 6)

Create multidemensional array, string and other array
Hey everyone, I want to create a listbox where the user can select a chord shape. Then i want to do some calcs with that selected item. So i want to che...
[15 replies] Last: Ok thank you, will read up! (by wimvandenborre)
Size of largest string in vector
I'm wondering if there is a better way to get the size of the largest string in a vector without using loops and if there are there any general imporvement I ca...
[10 replies] Last: @Peter87 Thanks! You taught me a new pitfall. In this case std::r... (by mbozzi)
How to place a space at the end of cout
I need to know why c++ doesn't see the space just at the end of cout function. I'm using CLion and C++ 23 (language_standart) #include <iostream> #include <s...
[10 replies] Last: Happy to help. (by Ganado)
Cout not printing in for loop
I cant seem to print int x within the for loop. Can anyone tell me why is cout not working inside a for loop? #include <iostream> using namespace std; ...
[2 replies] Last: How many times do you think the loop is going to execute? Hint: Never... (by AbstractionAnon)
by Hajo93
Can someone pls explain me why this wont work? struct S { int i; double d; const char * s; }; int main() { S s1 = { 3, 47.9, "string on...
[8 replies] Last: It would be helpful if the OP posted a Short, Self Contained, Correct ... (by George P)
Include eight headers, get a 1500kb program. Is this normal? (1,2)
Here are the eight headers in question: curses.h stdexcept Windows.h cctype ctime fstream stdexcept string I'm compiling with G++. Here's my compil...
[24 replies] Last: Yeah, I'm not concerned about a 600KB program as a practical matter, i... (by AidanofVT)
Knight Tour
Hey guys, I'm trying to do a recursion about the famous problem Knight Tour but it seems that my source code is wrong. I coded it using the algorithm found on I...
[9 replies] Last: #include <iostream> #include <iomanip> #include <vector> #include <u... (by seeplus)
Asterisks Shapes Together
I need help in writing a project in which dimensions are read in for different shapes and I need to output these shapes next to each other with same boundaries ...
[4 replies] Last: @OP Here's a start - note the extra j-loop for a box. You also need so... (by againtry)
Output formatting and Inputting lower/upper
Hello All! I was trying to finish up my program and I had the majority of the program finished however my output is slightly off and I'm wondering how to fix it...
[7 replies] Last: Well all I'm trying to do is format the options so it displays like t... (by George P)
Not sure how to add a running total
I need to add a running total to this, that adds the users price in case they want more pizza, but im not sure where to put it. (fairly new to this) Here...
[9 replies] Last: Thank you guys seriously ^^^ (by vasncode)
Beginner algorithm problem
New to STL algorithms and lambda functions. I have this problem where your have a vector of strings that you are supposed to filter into flags and parameters. ...
[2 replies] Last: You never change arg, so you should be able to make it const. (by Ganado)
CreateProcess() not working with exiftool
I am using CreateProcess() to run a process for exiftool in my program. My implementation is given below. The problem that I am facing is that, I want to pro...
[2 replies] Last: Try something like this: CreateProcessW(NULL, L"\"C:\\full\\path\\to\... (by kigar64551)
array with ints strings and doubles
Hi folks! Could you advise the array type to contain both ints, doubles and strings. Class is not an option
[10 replies] Last: Hi folks! Could you advise the array type to contain both ints, doub... (by jonnin)
expected unqualifed-id
I made ASCII art for a program and I'm getting expected unqualified IDs for some reason, I've had the ASCII art sitting there for a while and it didnt bring thi...
[1 reply] : main() needs a code body surrounded by {}. After L5 put { At the end o... (by seeplus)
by mmc32
windows.h vs fstream (1,2)
The standard library is a monster, it has so much functionality that I don't need. What is the smartest way to open and write to a file in C++? My idea was to...
[27 replies] Last: I think only the default buffer size is implementation-defined. ... (by kigar64551)
by mmc32
How does a productive day of study look to you?
How do you make sure that your day was a productive one in terms of studying things?
[1 reply] : It never is productive. I usually already know something or have no in... (by zapshe)
by pjhei
Matrix 5x5
Hi everyone, I just started studying programming at University level and this is the first course. I just encountered the task below and I'm getting a li...
[6 replies] Last: For both of these functions, you need a nested loop. Have a look at ho... (by seeplus)
Refactoring a class full of getters and setters
Hey everyone, I haven't written any C++ code in a long time, but I recently started a new project and I'm using SFML. Years ago when I was in highschool, I actu...
[6 replies] Last: Since the class has no default constructor, a question you should be a... (by jlb)
Function’s Argument Evaluation and Type Checking
Hello, Could you please explain it and give me an example? I didn't catch it. 1- A function’s argument is evaluated only once when the function is called. 2-...
[2 replies] Last: 1. If you pass an expression as argument to the CIRCLE_AREA the expres... (by Peter87)
If...Else Statement doesn't executes
Hi, I want to develop a code where the user has the decision to create an account or continue as a guest, but the "if" nerves get executed. I didn't continue th...
[3 replies] Last: [quote=dhayden]In the future, you can tag bits of code by highlighting... (by Peter87)
April 2022 Pages: 1... 4567
  Archived months: [mar2022] [may2022]

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