-
Replied To a Post in [vectors] 3D vectors?!
You need another class. You should have a school class that has a vector of classrooms. The classroom class should hold on to what floor and room number it is. … -
Replied To a Post in No matching constructor for initialization
Yeah I was just reading up on that. If a constructor has all default paramaters in the initialization section then it is treated as a default constructor. -
Replied To a Post in No matching constructor for initialization
Do you need the default constructor marked explict? If not I would remove that and see what happens. -
Replied To a Post in No matching constructor for initialization
change line 18 `HardwareRecord(int=0,std::string="",std::string="",double=0.);` to `HardwareRecord(int account=0,string name="",string description="", double price=0.0);`. That should fix it. -
Replied To a Post in Ubuntu, .NET, C++
I would take a look at [this](http://www.mono-project.com/Main_Page). I have reads some review though that call this a second class citizen compared to MS C# -
Replied To a Post in NESTED IF STATMENT
if (!(assignment == complete)) if (today > dueDate) return failure; else output << "Get working on your code. We only give help to those that show effort and code!!" -
Replied To a Post in create a program
What do you have so far? -
Replied To a Post in [question] Operator overload
> Java being programmed to make bad code harder to write I don’t think there is a language on earth that makes bad code harder to write. I do understand … -
Replied To a Post in Values read from vector unexpectedly different within the same function.
I have stepped through your code and it is working and putting new players in open slots. One thing with it is that every time you enter the function `SelectRandomSlot(vector<Player> … -
Replied To a Post in reading single integer from textfile
There is nothing wrond with using the function provided by the STL. You are using `string` so you might as well use what string offers. char stri[]="hello"; cout<<sizeof(stri); In the … -
Replied To a Post in [question] Operator overload
That doesn’t make operator overloading bad. Even Java has certain types that have operator overloads because it is so natural for that type. Take string for example. The `+` operator … -
Replied To a Post in Values read from vector unexpectedly different within the same function.
I have a questions for you. Why does `Players` have a size of 1000 when you only need 128?. If you post the full code I can step through it … -
Replied To a Post in [question] Operator overload
@ Rajeev Kumar_1: how is operator overloading bad? -
Replied To a Post in reading single integer from textfile
Learner010: The string objects size is only going to give you the number of alphanumeric characters in the string. It is not going to count the null at the end … -
Replied To a Post in [question] Operator overload
Well if you have why Java doesnt then that answers the question. Think of it as "Why does Java not support operator overloading?". -
Replied To a Post in reading single integer from textfile
A char is an intergal type. That does not mean that a char is an int but it is of a type that will be implicitly converted to an int. … -
Replied To a Post in Reading first word from file
Change while(std::getline(fin,line)) { for(i=0;i<line.length();i++) { line.substr(0,'32'); } cout<<line<<endl; } To while(std::getline(fin,line)) cout << line.substr(0, line.find_first_of(" ", 0)) << endl -
Replied To a Post in reading single integer from textfile
I would read in the entire line and then break it up. string line; int total = 0; ifstream fin("file.txt"); while (getline(fin, line)) // get the line { // loop … -
Replied To a Post in Switch menu
Well you need to do error checking in your program to make sure the input file opened. You could do this ifstream inFile("TEST.dat"); if (!inFile) { std::cout << "Error with … -
Replied To a Post in Switch menu
`ifstream in("TEST.dat");` on lines 49 and 70 needs to be just one decleration done before the switch statement. -
Replied To a Post in how to erase map of vector
Given SPLINKS contains: 1 3 4 abcmap contains; 1=> 1 2=> 2 6 3=> 1 2 4 What should the results be when the operation is finished? Maybe this? SPLINKS … -
Replied To a Post in project on Reservation system in c++
I can vouch that iamthewee knows what he is doing with c++. Think about your system. You normally have different types of transportation in any fleet do you need a … -
Replied To a Post in project on Reservation system in c++
Hate to burst your bubble but according to your guidelines you are to late to submitt this. What kind of idea do you need to start this? The sheet gave … -
Replied To a Post in maze traversal,
No. We dont just give code. show us what code you have and what is wron with it and we can help you with that. -
Replied To a Post in help me plz
how can you swap 5 numbers? What are the exact reqiurements for the assignment? -
Replied To a Post in help me plz
What do you have so far? Do you know what a pointer is? We only help people that show effort. If you dont show your code you dont get code. -
Replied To a Post in Counting sort while taking data from the file
@AD If I run the following code that you said to use I get the following output from the array. This is using the sample set of data the OP … -
Replied To a Post in Trouble With Operator= in Insertion Sort
If you are going a comparision which i think you are since you are returning a bool you need to change this: bool operator=( const PCB& other ) { return … -
Replied To a Post in Counting sort while taking data from the file
Since the file is formatted like 59,54,40,79,38 28,98,77,71,74 Will that getline work? What happens when it hits the newline between 38 and 28 since you overwrite the default delimiter? -
Replied To a Post in cin>> and cout<<
They are for getting input and pushing out output. cin is a input stream object and if you use `cin >> someVariable` you can think of it as from cin … -
Replied To a Post in Counting sort while taking data from the file
@AD What does line 7 do? I have never seen that. -
Replied To a Post in Counting sort while taking data from the file
I would think you should be able to do this. I have not tested this. // main always returns an int so dont forget to change this int main() { … -
Replied To a Post in load person info from .txt
Oops my Bad. Thanks for fixing my mistake nullptr. -
Replied To a Post in Help resolve questions
What have you done so far? What part of the problem dont you understand? You have to put in an effort if you want help. -
Replied To a Post in load person info from .txt
Well with the struct that you have and the way the file is formatted I would use the following approach. int main() { ifstream ifsSubor; ifsSubor.open("vstup.txt"); string sRiadok; vector<OSOBA> osoby; … -
Replied To a Post in load person info from .txt
What does the data in the file look like? -
Replied To a Post in How to count contiguous and common zeros in various arrays
Well I gave you a solution for the problem you asked for. You can't keep changing the goal post as iamthwee has said. I'll leave it to you to figure … -
Replied To a Post in clock_gettime
Well the different choices are for which clock to use. `CLOCK_REALTIME` uses the full system time. `CLOCK_PROCESS_CPUTIME_ID` uses the time in the process and `CLOCK_THREAD_CPUTIME_ID` uses the time from the … -
Replied To a Post in clock_gettime
if you have a compiler that support c++11 check [this](http://www.cplusplus.com/reference/chrono/high_resolution_clock/now/) out. It will show you how to use the high resolution clock available in c++11. -
Replied To a Post in How to count contiguous and common zeros in various arrays
If all you want to do is to change the zeros in a column to 99 if all of he arrays have a zero in that column then you can … -
Replied To a Post in create simple reference number
Well you have a couple ways to approach this. If all of the forms connect back to a central server then the server can hold on to the reference number … -
Replied To a Post in memory management with std::map and pointer to newed object
You need a destructor for `MyCon` that frees the memory. Something like this should work. ~MyCon() { delete [] matA delete [] matB } -
Replied To a Post in the digit
What is your definition of a digit? A number is a digit or is made of digits so I'm not sure what you are talking about. -
Replied To a Post in measure time inside 2 loops
How are you outputting the time used? Line 31 just has `cout << "\nUsed time : " <<endl;`. Are you dealing with threads at all? Do youknow if the execution … -
Replied To a Post in measure time inside 2 loops
Can you show the actuall code you are using? -
Replied To a Post in open source
Download the file called "ekiga-4.0.1.tar.xz". It is a tarball compressed with xz looseless file compression. in windows you can open it with 7-zip. -
Replied To a Post in measure time inside 2 loops
If you want the time of the run of the inner loop for every iteration of the out loop you should be able to do this //... std::vector<std::pair<clock_t, clock_t>> loopTimes … -
Replied To a Post in grow array
What part of the code dont you understand? Did you write this code? You should also look into indenting your code properly. The way you have it now makes it … -
Replied To a Post in c++ for system programming
Did you already ask this [here](http://www.daniweb.com/software-development/cpp/threads/477478/why-us-c-better-for-system-programming-than-java)? Schol-R-LEA and mike_2000_17 did a really go job explaining in that post. -
Replied To a Post in [Error] cannot convert 'double' to 'float*'
On line 32 you have `value = amp*sin(2*pi*freq*t)`. `value` is a `float *` so assigning `amp*sin(2*pi*freq*t)` to value makes no sense because `value` is a pointer which is an integer …
The End.