General C++ Programming - February 2019

Match string exactly with regex
 
I want to create a std::regex that matches a std::string exactly. I have tried by just passing the string as argument to the regex constructor but that will obv...
[7 replies] Last: Makes perfect sense. Could be it is the best, too... this kind of co... (by jonnin)
Pointer question
 
I am just learning all the nuances of using pointers and have run into a sticky problem. I am building a binary search tree. I have allocated multiple nodes (u...
[6 replies] Last: this worked for me: int * p = new int; delete &(p ); but it is just... (by jonnin)
How to know what I don't know about C++
 
As a self learner,I am struggling to get any confidence in programming. When I see typical easy problem I just don't feel interested to solve. But when I see th...
[4 replies] Last: The problem I see when I read your post is that you do not understand ... (by jonnin)
by rhall
Get line number of error in c++ program
 
Hi.. I have a C++ program that I want to trap errors in. I have added the __try and __except code, but can't get what I want. In the __except error handler...
[1 reply] : Just use StackWalker. https://github.com/JochenKalmbach/StackWalker (by helios)
by elsa
Problems with UnsortedList
 
Hello. I am having trouble with the functions in my program, particularly the getChoice function and how to flesh that out to properly follow the guidelines of ...
[5 replies] Last: This worked, for reference. int main() { UnsortedList list; list... (by elsa)
Question hw
 
I have to create a program that calculates the total due on sales taxes for a quarter period of the year based on the sales and jurisdiction. I have this so f...
[7 replies] Last: We can already guess based on the posted data (despite one typo on it)... (by keskiverto)
How do we know if a cached item is valid or invalid ?
 
Could someone please let me know how to check if a cached item is valid invalid? Consider the following scenario : Suppose that we have a database that store...
[1 reply] : It depends on the needs of the application. I think it's mostly a que... (by dhayden)
I will need clues to run this program
 
Write a program that prompts the user for their name and then will compute a car's miles per gallon given input of miles driven and gallons of gas used. It sho...
[3 replies] Last: @doug4, Never! :) (by chicofeo)
EncodeArray Problem - I'm lost on this one
 
Hi guys, I have this question, I am completely lost on how to go about this. kindly help even if it is just the algorithm or pseudocode. I wouldn't mind If you...
[14 replies] Last: Awesome!!! (by chicofeo)
by Jolom
Help with Assignment
 
This assignment requires me to verify an ID code. Basically I am taking in a user string input and converting it into a char array. After, I have to compare eac...
[5 replies] Last: Just some additional thoughts (based on the code shown in the initial ... (by doug4)
by paulm
String literal to function and strcat()
 
I want to create a wrapper for printing statements, to make sure that the EOL-character is set (and only once!), and I want to be able to call this function dir...
[3 replies] Last: Thanks for the reply. After some playing around with it, I came to a s... (by paulm)
Help with Assignment
 
I have a problem given to me. It's just to create a hello world program. But, I can only use 45 characters at most. what the. So how do I do it?
[13 replies] Last: Woah. Thanks it worked! Now I can do a better and more interesting pro... (by Bulbasheen)
While loop
 
I am having trouble on figuring out how to read each line from a txt file into a decimal variable, the only argument that works for what I'm doing is char. H...
[7 replies] Last: It should be 1000, like the example output in the instructions. There ... (by chicofeo)
Need help finding a way to add a third function to my program
 
Please, do not double-post. Other thread: http://www.cplusplus.com/forum/beginner/250383/
[no replies]
Rational Numbers Homework Help
 
For my project, we need to ask the user for two non-negative numbers and it will display what the rational number is. And then, it will prompt the user to ask f...
[17 replies] Last: bool Rational::operator<(const Rational& first) { return (*this < fi... (by dhayden)
by Moolan
Lexical Analyzer Help
 
How would I go about creating a simple lexical analyzer that takes input files and checks character by character, Identifying each token. Also I want to use t...
[2 replies] Last: He probably wants to assemble the characters into tokens and identify ... (by dutch)
by frek
Matrices in C++
 
Hi, I've included the Matrix header file (http://www.stroustrup.com/Programming/Matrix/Matrix.h) in my program, but the VS compiler still doesn't recognize the...
[8 replies] Last: Thank you, it worked. Please take a look at this one: class T { pu... (by frek)
Cant Concate 2 variable
 
#include <Sim800l.h> #include <SoftwareSerial.h> Sim800l Sim800l; //declare the library char* text; char* number; bool error; void setup(){ Sim8...
[2 replies] Last: if this is supposed to be c++, you CAN use the + operator with strings... (by jonnin)
by namo
Overload functions to take vectors as parameters
 
Hello, so I had to overload virtual functions that work with linked lists so that they accept vectors as parameters. I did that but when I tried to print the va...
[1 reply] : This line doesn't make sense: newNode->info2.push_back(newItem.capaci... (by coder777)
Adventure game creation
 
How do I constantly display information that is being updated(Health bars) and not clearing it while clearing the rest of screen? (Code isn't even close to done...
[1 reply] : If you're looking for a grand vision of many separate screen areas, yo... (by salem c)
February 2019 Pages: 123... 11
  Archived months: [jan2019] [mar2019]

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