twomers 408 Posting Virtuoso

Alternatively, if you want to return something you could create a struct/class which contains the data you want to return.

#include <iostream>
#include <string>
#include <fstream>

struct names {
  std::string first_name;
  std::string last_name;
};

names read_from_file( std::ifstream &in ) {
  names i_names;
  in >> i_names.first_name >> i_names.last_name;

  return i_names;
}

Probably isn't the best example of how to do it but gives you an idea anyhow.

twomers 408 Posting Virtuoso

Maybe try a:

void printMe const {
 // Code here...
}
twomers 408 Posting Virtuoso

Yeah. I seem to remember a headline along the lines of "State of the union undress", which I chuckled at. Peta.... people eating tasty animals, right?

scru commented: you bet! +3
twomers 408 Posting Virtuoso

Wha'?

twomers 408 Posting Virtuoso

Apparently a whole pile of chicks... odd.

twomers 408 Posting Virtuoso

>> (Havent ever heard of them
Dude!? Where have you been. They're those old cynical fellahs. http://en.wikipedia.org/wiki/Statler_and_Waldorf

Animal :) He's that crazy drummer. Oh muppets.

twomers 408 Posting Virtuoso

Why do you need to cast or even make a and b? Just test num1 and num2:

using namespace std; 
int main()
{
    while(1)
    {
         int num1, num2;
         cout << "Insert two numbers" << endl;
         cin >> num1 >> num2;
         if ( ( num1 <= -1 ) || ( num1 > 5 ) || ( num2 <= -1 ) || ( num2 > 5) )
         {
                cout << "Incorrect input" << endl;
         }
    }
}
twomers 408 Posting Virtuoso

And you, madam, are ugly. But I shall be sober in the morning
-- Churchill (to a woman that told him he was drunk)

twomers 408 Posting Virtuoso

Depends how you program. If you're programming a GUI, like with win32api or mfc maybe, it's a doddle. There's this for displaying a picture in dos - http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044665557&id=1043284392 but I don't know if it works.

twomers 408 Posting Virtuoso

Why don't you show us what you have started and we'll go from there. If you have nothing started start and you'll be more likely to get help.

twomers 408 Posting Virtuoso

Well that documentary, Jericho, got a lot of the states blowed up. How many nukes were there?

twomers 408 Posting Virtuoso

>> it isn't much of an achievement.
Just goes to show that every vote counts. I can imagine a few anti-Obama people wishing they had turned up now though. Not something you hear every day. Who cares about the scale of it.

twomers 408 Posting Virtuoso

I possibly mentioned this before, but I still think it's funny: Christianity: In the beginning was a supreme being and he made the universe. Atheism: In the beginning was nothing and then it exploded.

You got links for the contradictions and written dates, JB? And not just someone's blog ranting ;)

twomers 408 Posting Virtuoso

You got a link for that, vegaseat? Did they give a reason for it?

twomers 408 Posting Virtuoso

Some kind of Easter egg. Found it two days ago.

twomers 408 Posting Virtuoso

Heh. That's a good title, "London falls as Gordon Brown bloodied in May Day election massacre". Did Obama win by seven votes!?

twomers 408 Posting Virtuoso

>> If what young jbennet's believes upsets you, you are not much of a believer in your own belief. Let's discuss this after your exams, please.
Heh. It's not really the specific topic on hand that irked me... it was the manner in which the point was made. As Dave said it's a straw man argument ... I guess I'm a purist debater when it comes to it and like void main have strong feelings on unintelligent* debate. Lemme say that I would probably have said what I said no matter the topic. You're going to have to take my word on that though.

Probably is too long. And we aren't really talking about Collins anymore.

* from my point of view

twomers 408 Posting Virtuoso

We get ITV alright, I just don't watch much television in general so I don't recognise the fella you're on about. Apart from watching eggheads at 6 on BBC2, which I do to relax after dinner and before study, and snooker due to the championship... I watch very little television.

twomers 408 Posting Virtuoso

I had some scotch the other day. Buddy of mine brought me some from Edinburgh (he's studying there). Top quality stuff... drambuie if I remember the name.
I got my final uni exams next week for three weeks. Fun, huh?

>> Onbiously i was wrong.
Heh. Maybe I should drink more when on these forums. That 'God existing only if you believe in him' is kinda like the quantum suicide and immortality paradox.

twomers 408 Posting Virtuoso

http://www.daniweb.com/forums/thread74236-36.html

let it begin....

The second coming? ;)

>> Well, it might not be as frenzied without Josh to stir it up. I guess we'll see.
Maybe we could get a new Josh...

twomers 408 Posting Virtuoso

>> i am aiming to restart discussion
I disagree. That's not an aim for discussion, it's an attack masked in terse humour.

>> The entire thread is pretty much an argument
I didn't really follow it much, but I felt (from brief readings), that it was more a discussion with heated views. JB's post belittled something a lot of people feel strongly about. If he simply said "So what do you think, is god just like santa, does he only exist if you believe in him?" that would be fine. I just thought his wording was ... putrefactive.

Don't mind me. I'm exam stressed. I need a hot whiskey.

>> What else do you figure it could be?
Heh.

twomers 408 Posting Virtuoso

What exactly is that meant to establish? Are you seriously trying to start anything other than an argument?

twomers 408 Posting Virtuoso

"He is an inspiration for many around the village"

I suppose inspiration is all relative.

twomers 408 Posting Virtuoso

A solution to what you desire is given pretty much straight away, but it makes an interesting read -- http://www.eternallyconfuzzled.com/arts/jsw_art_rand.aspx

It's not, however, a question about srand. That merely 'seeds' rand. You want to get random numbers which is rand.

twomers 408 Posting Virtuoso

Just made a delicious omelette. Mmmm. And coffee. For dinner. Good dinner. I recommend it.

twomers 408 Posting Virtuoso

Well, postal is a character array, as is address, so you can't use the == operator to do comparisons. strcmp should do it though.

I assume you don't realise that you can pass a structure directly into a function as a parameter.

struct thing{
  int x, y;
};

void thingy( thing &i_thing ) { // pass by reference or value as you feel fit
  i_thing.x = 2;
}

which should save all those parameters going into your function. A structure, basically, is a type which tidies up all that messy parameter passing. And as it's a defined type you can pass it into a function.

You might also consider using the std::string (from <string>). It allows == comparison which character arrays do not. Again, tidy way of doing things.

There are also better alternatives to system("pause")

twomers 408 Posting Virtuoso

Beamish. Anyone ever hear of it?

twomers 408 Posting Virtuoso

So a physicist is driving, speeding, down the road at 100 miles an hour. A police car is hiding on the road side and catches him speeding and starts chasing the car. Eventually, after a dangerous and death defying drive, the police man catches up to the car and stops it. He walks up to the man and says "Do you have any idea how fast you were going?", to which the man replies "No, but I know exactly where I am".

twomers 408 Posting Virtuoso

Well, first #include <fstream>. Make a type called std::ifstream. This is a stream which can read from files. You should have an array declared so loop through its elements and insert what you read from the file into the successive elements of the array... There's an example here somewhere http://www.cplusplus.com/reference/iostream/istream/operator%3E%3E.html

twomers 408 Posting Virtuoso

>> and most people who do work for charities don't do it for free
Being a poor student I tend to avoid people collecting for charity on the streets. Every now and then I can't and when they talk to me and ask for 20 quid a month I ask if they get paid. If they do I tell them to come back to me when they don't, and if they say they don't I tell them I don't believe them and walk off. Flawless.

twomers 408 Posting Virtuoso

Prying into people's social life ;)

twomers 408 Posting Virtuoso

Beat it :) I recommend working towards the corners (jagged corners)

twomers 408 Posting Virtuoso

I like this game. Got it to two. There are a number of bug in the game, though.

twomers 408 Posting Virtuoso

That's not a drinking issue, it's a drink-management issue. In my opinion if you're stupid enough to drink enough to make you do those things then you deserve them.

twomers 408 Posting Virtuoso

I saw it first on CSI! Though I predicted that one, oddly enough. Not the means, but the result.

twomers 408 Posting Virtuoso

>> Are you sure it was a hostile takeover attempt?
I was quoting from the link. They used the word "unsolicited". I'm of the same opinion, csgal. I thought it was by-the-books. I saw that term being used in at least two other articles too...

twomers 408 Posting Virtuoso

Cup of the best tea in the world.

twomers 408 Posting Virtuoso

Still though... didn't he give away a lot of his money? Or make some charity or something? The margin's not that big. Still though. He was there for a while. I wonder if he'll jump back.

>> He is up $2 billion from a year ago and would have been perhaps as rich -- or richer -- than Buffett had Microsoft not made an unsolicited bid for Yahoo (YHOO, news, msgs) at the beginning of February.
I read something similar before. How was their takeover bid of Yahoo 'unsolicited'? Were Yahoo on the market? Did MS put forward a reasonable price? Were they right to try? How is it unsolicited? It's like saying trying to buy a car is an unsolicited attack on a car manufacturer.

twomers 408 Posting Virtuoso

Short of physically moving them... you could probably get your desired response by playing with getch() from <conio.h> ... not standard header though.

twomers 408 Posting Virtuoso

Never liked the road not taken, much. But I do like "Out out", by Robert Frost a lot:

THE BUZZ-SAW snarled and rattled in the yard
And made dust and dropped stove-length sticks of wood,
Sweet-scented stuff when the breeze drew across it.
And from there those that lifted eyes could count
Five mountain ranges one behind the other
Under the sunset far into Vermont.
And the saw snarled and rattled, snarled and rattled,
As it ran light, or had to bear a load.
And nothing happened: day was all but done.
Call it a day, I wish they might have said
To please the boy by giving him the half hour
That a boy counts so much when saved from work.
His sister stood beside them in her apron
To tell them “Supper.” At the word, the saw,
As if to prove saws knew what supper meant,
Leaped out at the boy’s hand, or seemed to leap—
He must have given the hand. However it was,
Neither refused the meeting. But the hand!
The boy’s first outcry was a rueful laugh,
As he swung toward them holding up the hand
Half in appeal, but half as if to keep
The life from spilling. Then the boy saw all—
Since he was old enough to know, big boy
Doing a man’s work, though a child at heart—

ahihihi... commented: (^.^) +0
twomers 408 Posting Virtuoso

>> Many of the weapons we are buying don't have an enemy yet.
I like that, Lardmeister.

>> We don't have a manditory military service any more
How/why did that come about, actually? I thought it was still there. Politics and HR activists believing everyone has a choice?

twomers 408 Posting Virtuoso

I like this one:

The generation of random numbers is too important to be left to chance.

twomers 408 Posting Virtuoso

And 16 in some countries in mainland Europe.

>> I thought you were much too young to drink alcohol.
Also a subtlety ... being too young to buy alcohol doesn't mean you can't get it.

twomers 408 Posting Virtuoso

I think the risk is worth it on the off chance that it's legit.

On the other hand I once got some spam which filtered through. It was the typical kind of thing that you might expect, but what really tickled me was the fact that they had a few paragraphs from the Hobbit. It's obvious why they did it, but still amusing.

twomers 408 Posting Virtuoso

I think you are a sellout!

you don't need big numbers in a sport for it to be enjoyable. That's shallow. What you need is adrenaline, you know, like what you get when either team is *attempting* a goal. Those attacks are always exciting, and happen a lot.

Maybe I am.
The question is "What stimulates adrenaline?" Excitement.
Then the question becomes "What stimulates excitement?" the answer being a good sport.

How am I a sellout? One of my favorite sports is Hurling (not throwing up). It's an Irish amateur sport which from start to finish is quick, exciting, edge of your seat play and the players don't even get paid. There is no diving, not much dirty play. The players play because of their love for the game. Compare that, now, to soccer. The top players make millions yet they can't stay on their feet. Someone nudges them they fall down crying. If someone smacks a hurling player with their hurley (solid ashen stick), they bear it. Even if hurt. What I said about goals before was only one reason why I don't like the sport.

I have no respect for players who play without passion. Who play their sport to cheat in every situation in order to gain an advantage. I'm not the sellout, scru. Don't the American's (generalisation, don't hurt me), say they watch the superbowl for the adds?

scru commented: I think you take me too seriously. :P +3
twomers 408 Posting Virtuoso

Change:
if (guess< number, tries++)

to

tries++;
if (guess< number)
// ...
else if (guess>number )
//...

You should only need to increment tries once.

Our teacher hasn't taught us anything else about the different header files and such, so I am only using what I know. Furthermore, he told us we can use void main and return; instead of return 0;.

I think Salem had a good rant about this kind of situation.... http://www.daniweb.com/forums/post513685-4.html Not all completely relevant to your situation, but some might be.

You can avoid returning things by declaring main as void. He's right. But you can also avoid paying taxes by not doing so. main is defined by the standard to return int. Some compilers flag this as a warning, some errors. Some disregard it completely. But it should return int.
Take a read of this -- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044841143&id=1043284376

twomers 408 Posting Virtuoso

#include <iostream.h>
#include <stdlib.h> // For Randomization
#include <time.h> // For Randomization
#include "msoftcon.cpp" // External Application

void main()

<iostream.h>, <stdlib.h> and <time.h> should not be used. Use instead <iostream>, <cstdlib>, and <ctime> In terms of <iostream.h> ... it's old. <iostream> is new and good. The other two are used in C++ rather than what you supplied which are C headers.

Void main is bad. Main is defined to return int. use int main()

>> if (guess< number, tries++)
Nope. comas don't go well in if statements. What do you want to test it for? I think you should have tries++ after the if statements before the end of the do-while loop.

>> if (guess> number, tries++)
Same as above, but I reckon that should be an 'else if' rather than only an if.

twomers 408 Posting Virtuoso

>> If you would know the secret sex life of the royal family, you would drop this claim!
Heh. I can't make any promises.

twomers 408 Posting Virtuoso

>> the royal family suck, but the queen is ok
The royal family is probably (and I don't mean this offensively, just stating facts), the most inbred family in the UK.

I think football (UK soccer), is stupid and boring. You watch it for an hour and a half and unless you're fortunate no more than about two goals are scored. I was glued to the TV when I was watching the SuperBowl. Though you know what they say about new things, I suppose.

twomers 408 Posting Virtuoso

That's the beauty of argument, if you argue correctly, you're never wrong.

Incidentally, if you haven't seen the movie watch it! It's excellent.