General C++ Programming - April 2017 (Page 5)

Lexical Analysis Question:
 
For my lexical analysis program (which reads in one char at a time from file with getChar) I have a getToken function that determines (then returns) a token for...
[1 reply] : You do.'t seem to have a comment state. (by kbw)
Reading in file to an array thats part of a class
 
Hello all, I need to read in a file with floats into an array that is initialized as part of a class. I know this is very basic and short code but I cannot ...
[2 replies] Last: Thank you for your help! (by VicariousGeorge)
by Fey
Help to start a display function
 
Hi guys , so I started a program where every answer or assigned value is returned to v ( return v) . I need help to develop a function to display it . I have t...
[no replies]
declspec making problem with class constructor
 
In my game engine, before I updated my code I had no problem and my classes looked like this: #ifdef LIGHTENGINE_EXPORTS #define LIGHTENGINE_API __declspec(d...
[5 replies] Last: You have a struct in a DLL that has public member objects. The compil... (by kbw)
Stopping infinite loop
 
Hi there. New to the site and to programming in general. I'm currently a student and we are doing a project for C++. I have modified my instructors code and now...
[2 replies] Last: I'll try those changes right now. Thank you so very much! (by clove311)
Trie Implementation Woes
 
I'm trying to implement a trie that can print out the frequency of words with a given prefix. Here is what i have so far: Trie Class: class Trie { publ...
[2 replies] Last: I was able to find the error. It had to deal with me not initializing ... (by alkorith)
I need some help. How to make a check invalid month, days and leap year.
 
#include <iostream> using namespace std; const int JANUARY = 1; const int FEBRUARY = 2; const int MARCH = 3; const int APRIL = 4; const i...
[7 replies] Last: Just use an enum to ensure right uses of months. It is recommended to ... (by benhart)
Media using class c++
 
Hi! I would like to know why the return value of media() is random! Thanks! #include <iostream> #include<string> using namespace std; class...
[2 replies] Last: Thanks! (by joaopragosa)
Test types
 
Hello, When we want to test types, i know that the "best" way to do so from an OOP aspect is to use polymorphism and make virtual methods ... But why exactl...
[2 replies] Last: @OP I wonder if you mean that things like RTTI (eg typeid) and dynami... (by TheIdeasMan)
Jarvis March Algorithm problem
 
Hi There Im new to this site. Im currently implementing jarvis march algorithm with breezenhams line drawing. Im currently having problems with this as the l...
[no replies]
Recommendations: Book parsing mathematical functions/expressions
 
Hi everyone ! I'm sorry if the topic already exist, i was looking but i don't find it. Also, i apologize for mi terrible english. I'm looking for a book tha...
[1 reply] : I have here Bjarne Stroustrup's book "Programming -- Principles and Pr... (by nuderobmonkey)
How do I create an infile with a Mac (Xcode)?
 
I did this but there was an error. I don't know how you can do this. // open the infile ifstream inFile; inFile.open ("in6s17.txt"); ...
[1 reply] : Maybe the file is not there. Anyway it's better to use perror to get a... (by Thomas1965)
cout help
 
How do i get this to work? void BSTree::printInorder(Node* node) { if(node!=nullptr) { this->printInorder(node->Left()); cou...
[1 reply] : You need overloading the 'operator<<' function which handles the ostr... (by nuderobmonkey)
How is this read aloud?
 
I like to use the proper terms when reading code out loud to myself, and I don't know how to read the '::' symbol in the context of 'std::cin'. Can anybody help...
[3 replies] Last: If you were talking to another programmer you'd call it "std cin". ... (by SamuelAdams)
C++ DLL building _declspec(dllimport) errors.
 
As I am building a new version of my game engine dll with just updated code, I'm getting errors that I never had before. Every error contains "_declspec(dllimpo...
[1 reply] : help? (by Putarda)
by cooka
Should compute the following menu with call by reference. Thx for ur help.(ps : I'm not that gd in function)
 
#include <iostream> using namespace std; void readValues (int & ,int &); // 2 values A and B int factorial (int &); // A int divCount (int); // A void evSu...
[6 replies] Last: hi cooka, seems you are a student and this is a college program. as i ... (by eec)
by m1smr
Learn OpenGL or Vulkan?
 
Hello, I want to learn a graphics API, but I´m not sure which I should learn. Is it still worth learning OpenGL or should I learn Vulkan? I have no expe...
[1 reply] : Opengl is a great starting place ... its been around for a long time a... (by jonnin)
Reading using getline
 
What i need to do is read in a line, take the first 4 to see if a class is being offered, then the rest of the line is the name of the course. The name varies i...
[1 reply] : one way might be to use string.erase read the line copy it to string1 ... (by SamuelAdams)
view a text file
 
Hi guys, here is my program about a carpets company, i did the 2 menus where you can place the order, but in the case 2 i need to show the daily order, and in c...
[1 reply] : It's your homework, maybe you should do it yourself ? If you have a q... (by SamuelAdams)
erasing element from a list which will traversed
 
So far I know it's forbidden erasing an element from a list while this list will be traversed. Is this right? If so, exists there a common workaround for preven...
[6 replies] Last: To me, as I'm at a relative beginner level, I've used for almost all ... (by nuderobmonkey)
April 2017 Pages: 1... 34567... 16
  Archived months: [mar2017] [may2017]

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