Beginners - November 2019

Template question
 
I can't figure out why my swap calling on lines 79 and 82 are not working. It worked before I had to convert the whole program to use template. #include...
[1 reply] : Double posted -> http://www.cplusplus.com/forum/beginner/265842/ (by salem c)
Template question
 
I can't figure out why my swap calling on lines 79 and 82 are not working. It worked before I had to convert the whole program to use template. #inclu...
[1 reply] : This looks like a problem caused by the "using namespace std;" clause.... (by jlb)
Displaying a claculation
 
Hi, i've tried searching here and online for an answer and couldn't seem to find one maybe you could help: I have an assignment creating a kind of change calc...
[6 replies] Last: ah i should have thought about using a loop :D (by tunplus)
by Hajo93
School task
 
The application prints a menu with the following choices: Read student information from file Write student information to file Exit The user (and my tests...
[2 replies] Last: With CPP it's kind of looks like this. #include <iostream> #include ... (by Davoda1)
C Programming - Multithreading using pthreads
 
I want to understand how multithreading in C works. I am trying to convert the following code below to a multithreaded version in C programming language, using ...
[3 replies] Last: Step 1, get the work you need to do into a separate function. int ch... (by salem c)
declaring winner
 
The bottom if else statement doesn't seem to declare a winner and always endsin a draw no matter the score. #include "pch.h" #include <iostream> #inc...
[4 replies] Last: Thank you! I copied and pasted my code into a new project and it worke... (by renegadepotato)
by Ch1156
best way to do collision
 
So I want to make an adventure game but I dont want to do a text game, I want there to be some "graphics" so I want to write a map generator, which shouldnt be ...
[5 replies] Last: Ok so I went the route of having a vector that contains a list of coll... (by Ch1156)
Simple Adjacency List
 
Guys!I am trying to do this! X | A->C Y | A->B->C Z | B->C I want a pointer on left(X,Y,Z) to point to first linked list then increment and move down(Y) and...
[1 reply] : Should I create another struct abc type array? Yes, or use another li... (by kbw)
fstream
 
why is this not loading details from file //container implementation void itemcontainer::loadsItemDetailsFromFile(char* file_name){ ifstream myin(fil...
[2 replies] Last: Hello Ruchina, PLEASE ALWAYS USE CODE TAGS (the <> formatting button... (by Handy Andy)
help with _getch()
 
i am using _getch() to detect keyboard input and i am working on my project on a mobile IDE (Cxxdroid) while i am travelling etc, and on my computer when i am a...
[13 replies] Last: okay that makes a lot of sense, thanks <3 (by tunplus)
Difference between double hashing and rehashing
 
So I implemented double hashing here i.e using two hash fun. But what does it mean by rehashing? How would I do it with this same program? Thanks #include...
[4 replies] Last: Thanks a lot both of you! (by lost110)
by ema897
derived class files
 
Hi! I have a base class from which I want to derive many derived classes. Where should I put the derived classes? In the same .h of the base class or do I nee...
[1 reply] : Where should I put the derived classes? This really a design questio... (by jlb)
How to refernce variable length array with pointer
 
project description: I have an esp8266 that is receiving a string representing a color pattern of rgb values with a time for transitioning to the next color. e...
[8 replies] Last: line 21. is that syntax saying, there is a read method, where line 35... (by jlb)
class declaration fails
 
What's wrong with the 'Subject' class declaration? enum class Type { Ground, Enemy, Boulder, Friend }; template<typename T> class Object { public: ...
[1 reply] : Fond the error, line 26 needs to be: class Subject : public Object <... (by nuderobmonkey)
by hbcpp
Level My C++ Skills
 
I have been studying C++ for almost 2 years now. I have read some beginners' books and some intermediate ones including "Effective Modern C++ - Scott Meyers". ...
[11 replies] Last: Well now I am curious to learn python or java to be able to spot these... (by hbcpp)
Returning struct member from function
 
I am attempting to read info from a file, calculate averages, and return the lowest percentage and the occupation associated with it. The program originally use...
[2 replies] Last: You have no return statement. It seems that your function should be u... (by keskiverto)
How to include the value of getclassname() in if statement
 
Hi all, I would like to include the window class name into my if statement but I always get error. It is the issue of char and string but I tried several times ...
[5 replies] Last: Yes. The std::string(class_name) calls string constructor std::str... (by keskiverto)
Arrays and for loops
 
Why does printing an array take so much longer than checking what is in an element using a for loop. For instance. for (int i = 0; i <10000; i++) ...
[3 replies] Last: Switching to '\n' probably won't make a difference since cout is usu... (by dutch)
About Java.. can help me?
 
Can you help me?????
[3 replies] Last: A nice steaming mug of Java might be nice right about now. (by George P)
program not working (if else)
 
Hello everyone ! I am trying to create a function that reads a file which contains doctors record. If doctor id exists it shows doctor but if not then it shoul...
[3 replies] Last: > it prints nothing > searchDoctor.open("Doctors.txt"); This can fail... (by salem c)
November 2019 Pages: 123... 17
  Archived months: [oct2019] [dec2019]

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