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...
[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...
[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 ...
[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){ ...
[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 =...
[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...
[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...
[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...
[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...
[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...
[4 replies] Last: How to access the vector of vectors in cpp A 'vector of vectors' is ... (by George P)
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 ...
[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...
[9 replies] Last: IF you do install VS you need to do a custom install. The C++ packages... (by George P)
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"; /...
[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...
[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...
[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...
[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 ...
[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...
[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.
[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(); } // ...
[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.