To M.Richard Tober: I am sorry. I have a mistake in the first post.
The sellerID is mixed up here, in the first post. It is actually 3 1 3 1, this can be "easily" viewed if you look at the cost,...
Type: Posts; User: ManyTimes
To M.Richard Tober: I am sorry. I have a mistake in the first post.
The sellerID is mixed up here, in the first post. It is actually 3 1 3 1, this can be "easily" viewed if you look at the cost,...
Hello, as phantomotap says: tried anything? Show the code.
std::vector can be initialized just when you are creating it, like this:
//Creates 2D vector of size 10 and the 0 in the line below...
You're almost there, but then again not. :)
>>"Given Car #1, then Seller ID #1 is the cheapest." True
Almost, take the service-cost into consideration if a seller gets picked (is the cheapest,...
Hello!
For sake of the example, there are sellers who sells cars, where each car has its own price from different seller. A seller also has an additional service price which will always be added...
Why do you guys always spam a thread with posts that are not topic related? Post count ftw? Do not answer!
I have asked for "Any other ideas?", which mean if anyone has another way of doing this...
int a;
int b[4];
b[1] = 1; b[2] = 5; b[3] = 3
for(int i = 1; i < 4; i++)
{
for(int ii = 1; ii < 4; ii++)
{
if(b[ii] < b[i])
{
syzgy: I know, I could have put all three classes actually inside one class, but thats not the point. That did not answer your question; "What is the point of doing that?".
Doing what? The last...
Hmm... No idea what that is. *googling*
I am sort of looking for that, I think... but, take this sample:
class A
{
private:
int a;
Lets say I have these three classes, I mean, lets just not say, but I really have these three classes and they cannot be changed;
class A
{
};
class B : public A
{
File: Test.cpp
#include <iostream>
using namespace std;
Test()
{
name = "Abc";
cout << name;
}
CodeBlocks?
http://www.codeblocks.org/
MS tools are only good for MS stuff, but if any, VS 2008 Express or wait a bit for 2010?
Else; eclipse is really neat....
while "letter" is less than Z, which it will be at least the first time, because you've just set it to 'A'. what about the second time the while loop runs?
Next time the loop goes on, It is still...
>>pass variable from one function to another
void Function1(int i)
{
cout << i;
}
int main()
{
Dijkstra's algorithm - Wikipedia, the free encyclopedia
Dijkstras algorithm... with a code there already, so... :)
You should have shown some code... Useless to help elsewise... Kind of! :P
But, I made one little thing up for you, hope it helps you in the right direction! :)
#include <iostream>
#include...
>>Now I'm just trying to get it to only accept positive input numbers.
So, you want the "int cost" variable, to make sure it is positive, at all times? Right?
I would have created a new function...
Well...
A for loop looks like this (or better said; it can look like this)
for(int i = 0; i < 10; i ++)
{
cout << "Value of integer variable i: " << i;
}
If you want to do a thing, at...
Jesus holy...
I needed a "innfil.ignore()"; It solved everything, I see now, it doesnt know when to "jump to the next line", unless i tell it to do so...
#include <iostream> // cin, cout
#include <fstream> // ifstream, ofstream
#include <cstring> // strcpy, strlen, strncmp
#include <cctype> // toupper...
Thanks, but next time instead of writing two lines which actually don't answer my question, just write the little "snippet" down instead?
For instance:
int i= char[4]-'0';
Because, I know what...
int main()
{
char* c = "123456";
int i = atoi(c[3]);
//i = (int)c[3];
//i = atoi((char*)c[3]);
//i = atoi((char)c[3]);
//char cc = (char)c[3]; i = atoi(cc);
//none works, what in the......
Thanks for responding.
1. Ok, next time I'll do that! :)
2. Nice thinking, of course privatize it!
3. Huh? So what should I do then? I try to read from the file a "line" in the size of my...
Hello!
How can I read a class object from a file that I have just written to.
The class
class Hired
{
private:
int nr;
Works now! Lovely, love you! Knew it was simple, just... :)
Hello!
I got one class named Hired and want to write the whole class into a file. But upon execution the program stops and ends without even create the file.
Also; how do I call the construtor...