You are on a c++ forum, that kind of lack at attention to detail makes me wonder about you.
I am a Java Developer and if you post to https://jsfiddle.net/ I will help you out.
What is up with...
Type: Posts; User: jocdrew21
You are on a c++ forum, that kind of lack at attention to detail makes me wonder about you.
I am a Java Developer and if you post to https://jsfiddle.net/ I will help you out.
What is up with...
Sorry I am not at my computer/compiler at the moment but I would like to thank you for the replies. @ Elysia you mentioned Lamda's. How would I accomplish this code in a Lamda? I am asking because I...
I made a simple binary tree then decide to try out threads too. I got the following error:
call of an object of a class type without appropriate operator or conversion
#include "Tree.h"...
I was not sure if he was trying to access private members. ie if there was a private variable in one of his functions what was suppose to return it value. The cpp file was not posted but I knew...
Program( CompactDisk disk);
When you create a new compactDisk into Program in main it is aware of the fields of compactDisk
Ok before I am attacked by someone whom is more refreshed on C++ then I am I just I been using C# and Java ALOT and very little C++. If you do not use it you loose it but this seems to be a very good...
I handled that in the print function. Just to make sure I did what you said and I got an out of 2 for Alex when I know it is 1. I get one when way I have written it below:
void...
Got it to work!!! Thank you Elysia....
#include "WordCount.h"
WordCount::WordCount()
It is not working but this is what I have. If this what you were referring too. I am taking your advice, or at least attempting to. I am going to try the map<string,int> myMap approach after I get...
You're right...
I used the Word object because I was thinking the collisions would cause an issue. Meaning "Mike" and "Mike" have the same key and the countOccurrence function in the Word...
Ahhhh..... Don't I look silly.....
This what I am trying to do:
1) Get occurrence of a word in a sentence, and count how many times that word occurred. For example if you were writing a ransom...
I am trying to solve some random puzzles so I do not lose/forget c++. I never used hashtables in C++ and decided I needed to brush up. I am having in creating a hashmap that holds objects with a...
Have you learn recursion yet? This would be a great problem for that!!!!
If you have not learned that yet get a piece of paper and write down what is happening in the loop or use breaks in your...
I am still working two issues, one is it is sorting the licensePlates together now but not in the order I would like here is an example of what the output is:
315630 4 21 17 34.\
315630 2 21 16...
struct{
inline bool operator() (Vehicle v1, Vehicle v2)
{
//return v1.getLicensePlate().compare(v2.getLicensePlate());
return v1.getLicensePlate() <...
Thank you for the replies and the reminder of pass by value vs. reference, I have since fixed the issue.
struct{
inline bool operator() (Vehicle v1, Vehicle v2)
{
...
Since no one has responded yet I still need a little advice. The above is sorting the times, not the string of license plates. Another thing that makes me believe I mishandled this is that it take...
I got it..... I really want to take this post down but for the sake of others learning I will post the answer:
That is how you compare objects in a class using the sort function.
struct{
...
I have a class that has a few variables and getters / setters. I set these variables and then place the node into a vector.
vehicle.setLicensePlate(plate);
...
I agree, I already created this program in java and used the following. The junk data was handled before this but you brought some unique light on how to handle that.
String line,time,plates;...
This would be a prefect job for a hashtable.
Jim..
Thank you, your way was a lot faster than my method of choice and easier to read! That example just changed how I will treat unwanted data in a file forever.
The file has 72,000 vehicles, and 5 cameras. I just have to calculate the distance it traveled in seconds and convert it to MPH or KPH.
I will simplify the readFile, I was just debugging...
...
I did that because I assumed no one would want to compile the code, I just showed the important code that pertains to the question. I thought I would annoy you guys by posting an entire program...
Did I make you guys mad?