Beginners - October 2020 (Page 7)

Qt Snake game model/view/controller
Hello everyone. I have a snake game in C++ Qt. To get a working game I have done it in one file. Now I need to split it into model/view/controller. Model is ga...
Oct 17, 2020 at 12:22pm
[2 replies] Last: sorry forgot to add original game #ifndef SNAKE_H #define SNAKE_H ... (by jamesfarrow)
by Mif
How to break an input statement with KEY_ESCAPE ? in 'C'
How to check if user pressed KEY_ESCAPE ? If user type something and change his mind and wana return to prev. menu I want to add ESC key from keyboard and anyt...
Oct 17, 2020 at 12:21pm
[12 replies] Last: I've now developed this into a fairly fully featured line editor. The ... (by seeplus)
Split main.cpp into a header file and main.cpp
Hello, everyone. I need to make a header file with 3 functions, "generating new key", "encryption" and "decryption". Then, just include this in the main.cpp so ...
Oct 17, 2020 at 12:06pm
[5 replies] Last: std::size(msg) includes the terminating \0 (by seeplus)
Am I making this function correctly?
I need the function ShiftLeft to move to the left. Kind of stuck void Hostess::PlaceArrivalInQueue(int arrivals){ if(queue_size<15 && arrivals!=0){ ...
Oct 17, 2020 at 7:35am
[2 replies] Last: If the queue head is position 0 - which is to be removed, then somethi... (by seeplus)
by konoza
Exam Revision
class Shape { protected: Shape(); public: int getShapeNumber() const; private: int shapeNumber; static int nextNum; }; int Shape::nextNum =...
Oct 17, 2020 at 3:03am
[1 reply] : Making the constructor protected, means that this class cannot be inst... (by konoza)
difference question
What is the difference between initialization and assignment? Initialization gives a variable an initial value at the point when it is created. Assignment give...
Oct 17, 2020 at 12:07am
[4 replies] Last: for simple things like integers, it does not make a lot of difference ... (by jonnin)
by Horror
How do I make it go in diagonal directions?
I have code that I already have four basic directions (Up, Down, Left, Right). However, I want to have them go in diagonal directions as well, so it will add up...
Oct 17, 2020 at 12:02am
[1 reply] : just go there. to go north west, its row-1 and col-1 from where you ... (by jonnin)
by BrianD
weird error
Hi I an very new to this and have a question I am following a book to learn C++ and it tells me that I should put user headers first in my main program then 3rd...
Oct 16, 2020 at 7:35pm
[12 replies] Last: Your use of comments as a beginner is fine, since it's just helping yo... (by Ganado)
having a formatting problem
In the program I wrote the 'Y' should line up under the 0059 and the '@' should line up under the 0040. Function address_view prints correctly for int and ch...
Oct 16, 2020 at 6:34pm
[4 replies] Last: for completeness here is the fixed function. Thank you again. templa... (by closed account oivD8vqX)
Vector of Vectors
How to access the vector of vectors in cpp. And the loop is running infinitely. How to make it run only once for the given condition. Or is there a way to acc...
Oct 16, 2020 at 5:12pm
[4 replies] Last: How to access the vector of vectors in cpp A 'vector of vectors' is ... (by deleted account xyzzy)
Why don't I get an output?
I'm in an intro to c++ class, and I'm trying to complete an assignment that completes the following steps: a. Prompt the user to input two integers: firstNum ...
Oct 16, 2020 at 5:05pm
[1 reply] : The for loop increments firstNum until it is greater than secondNum. W... (by seeplus)
tutorial request problem
The tutorial I'm using currently was suggested by somebody in this forum. Seem to keep up with the updating but the problem is. https://www.learncpp.com/cpp...
Oct 16, 2020 at 3:59pm
[9 replies] Last: IF you do install VS you need to do a custom install. The C++ packages... (by deleted account xyzzy)
Is there a way to change a cast off a const
I want to take const variable cast off the const give it a new value and make it const again. Can I do that? void f() { const std::string s = "wilson"; /...
Oct 15, 2020 at 9:05pm
[5 replies] Last: Thank you, I think I understand but I'm going to have to do some more ... (by closed account oivD8vqX)
Counting the number of times a number appears
Hi guys, I'm in a basic C++ programming class and I'm working on a homework assignment but it's asking me to do something that I'm not sure we have covered y...
Oct 15, 2020 at 6:19pm
[6 replies] Last: I got it figured out guys. Part of the problem was that I had the file... (by cloudwolf)
by Rlabee
requesting help with uniqueness
Hi all, Back again with another thing im not sure how to approach. I've written a program in wich you randomly type 10 numbers between 0 to 20, the prog...
Oct 15, 2020 at 6:17pm
[5 replies] Last: Thanks a lot again seeplus. Im going to compare our programs and loo... (by Rlabee)
Check if the input is integer
I need to create a program that accepts a name, to validate that a character and an integer shouldn't be accepted. I made a way to not accept a single character...
Oct 15, 2020 at 1:50pm
[4 replies] Last: #include<iostream> #include<string> using namespace std; string getN... (by lastchance)
C++ - incrementing integer variable does not work
So I'm creating a program that implements several classes representing a school, and its students and courses. I'm running into an issue in School.cc where the ...
Oct 15, 2020 at 1:36pm
[13 replies] Last: @OP FWIW, I reckon you data model and naming could do with a 're-spray... (by againtry)
Program will not compile
I am supposed to write a program for my class that calculates the windchill given the wind velocity ad temperature. I must use 4 seperate functions (one that di...
Oct 15, 2020 at 8:46am
[8 replies] Last: What about entering windspeed of 0 to exit? void readIn(double& T, ... (by seeplus)
by felloz
Finished the basic tutorial, whats next?
Hello, i just finished the all documentation about basic tutorial, what should i do next to continue my journey in c++? Thank you for your recommendations.
Oct 15, 2020 at 7:19am
[8 replies] Last: Now that you have learned the basics it's a good time to learn about t... (by Thomas1965)
by ebz
Hopefully a quick question regarding class functions
I have the following class which uses a few classes from a third party lib: #include <thirdparty.h> // assets.h class Assets { void Load(); } // ...
Oct 14, 2020 at 10:58pm
[2 replies] Last: Thanks for replying jlb, very sorry, I noticed I was doing this in my ... (by ebz)
October 2020 Pages: 1... 56789... 13
  Archived months: [sep2020] [nov2020]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.