447 Posted Topics
Re: One thing you could do is map out a directory. The structure could have the name of the directory, an array of sub-directories (which would possibly be a pointer to a new instance of the structure itself), and an array of file names as members. You can search through it … | |
Re: The pee from a cat reeks more than that of a dog, in my experience. My father throws things at cats who go into our garden! | |
Re: Jaz Hands *scuttles off stage in a diagonal direction* Some predictable ones, of course, but some good ones too. Jazz is great. I saw a great Jazz guitarest during the summer ... I can't remember the name of him for the life of me ... But if ye ever hear … | |
Re: So you get a star with every k? | |
Re: I got up to about 16 the other week. I'm 21. I was using some ultrasonic transducers I'm doing work on. It's weird. They're meant to have a narrow bandwidth at about 40 khz with 20dB/dec either way around the peak but you could hear well enough up to your … | |
Re: >> In Britain a pregnant woman can legally relieve herself into a policeman's helmet. I believe it's actually anywhere. But I'm not quite certain. It's been a while since I got that email ... | |
Re: >> Good time to go to the pub with friends! Yeah. Cause in Ireland we don't actually work :) Pubs 24/7, heh. | |
Re: Never timed myself. Don't know any of these systems though. Just did it imprompto. You know they can all be solved in less than 26 moves or something! [url]http://www.guardian.co.uk/science/2007/aug/17/2?gusrc=rss&feed=networkfront[/url] | |
I'm sure some of you guys have this already, but I downloaded this the other day and it's made my life (pretty much), so I thought I'd share. It's an addon for FireFox which blocks those annoying adds you see all over the place. Deffo worth the download, IMO. [url]https://addons.mozilla.org/en-US/firefox/addon/1865[/url] | |
Re: Got any computer screens you don't need? Or microwaves? Find a high wall and push. | |
Re: You want a user to enter the number of employees and an array with that number of elements? That should be easy enough. There are a number of options. You could use traditional dynamic memory allocation or alternatively a container class like vector. I'm going to assume you've not learnt … | |
Re: It should be protected rather than public. The Employee members. That's all I can guess here. If that doesn't work post some code. Pour example: [code=cpp]class thing { private: int priv_int; protected: int prot_int }; class inh_thing : public thing { public: void display( void ) { // std::cout<< priv_int … | |
Re: For the second question you could use \r in a print statement. This goes to the start of the line on the console window. So suppose I had this: std::cout << "hello, \rworld"; I would get out: "world, " Least I think it's \r Only danger with it though is … | |
Re: I really don't know what you mean, but you might want to open the files in binary mode... | |
Re: You're right. Why bother using code tags. >> int main(); >> { Should be >> int main() >> { No ; after main. | |
Re: If all you want to do is wait for a while you can use sleep...: [code=cpp]#include <windows.h> int main() { // Do something Sleep( 1000 ); // Sleep( miliseconds ); // Do more somethings return 0; }[/code]You can put the sleep in an infinite loop if you want it to … | |
Re: Well ... our 'prime minister' just passed a vote of no confidence from the opposition ... There are issues with money that appeared in his account too ... so I guess he has a sense of humour ... :) | |
Re: I couldn't see it kicking off. The sports which are popular here have had a long time to sink their talons into the hearts of their fans. American football... may be a passing fad but no more than that, in my opinion. | |
Hi all. In university we're studying different types of power systems and generation methods and one of the more interesting types are nuclear stations. I know where I stand on it but I'm curious as to what others think. For, or against? Please specify why. | |
Re: Don't forget that you need a ; at the end of your class defn - [code=cpp]class class_name { // ... };[/code] In C when you created a struct and didn't define it with a typedef you'd have to say: struct struct_name struct_instance_name; rather than what you'd be used to. However … | |
Re: So I haven't read this, but there's no mystery to the situation - [url]http://twomers.googlepages.com/ne.PNG[/url] | |
Re: Do you know how to use file streams in C++? Just create a file, it doesn't matter what you call it, for writing (ofstream), and then create another stream for reading (ifstream). Use the getline function on the input file stream ([inlinecode]while( std::getline(in, line) )[/inlinecode]), where line is a std::string), … | |
Re: Wow. We give out about people not giving us enough code all the time ... but [I]all[/I] the code... one would think it's a good thing... However, I, for one, am not going to look at any of them. I think it's generally said to post the smallest segment of … | |
Re: Simple file io. First hit on google - [url]http://www.cprogramming.com/tutorial/cfileio.html[/url]. All you need to do is point the file pointer to your desktop. You can hard code that if you want. Then open the file for reading (see link), and print its contents to screen. | |
Re: I really don't think it'll affect your either way. I mean. It's 15 const ints... | |
Re: I decided to go out in the last minute so I grabbed a cane, a pill box, some tictacs and hey presto I was Dr. House. A buddy of mine went as Predator and another as Awesomeo. Both were excellent but both made it awkward to drink anything! | |
Re: Yeah. I've always (not really), wanted to try vicodin since I started watching House. Not that I'm impressionable or anything... | |
Re: There's a lot of talk about drugs here of late (kinda). Did anyone ever play this game - [url]http://www.geekhideout.com/druglord2.shtml[/url] It's pretty amusing!! | |
Re: Create a string containing all the letters you want to use. Seed and use rand() to access elements (using the % operator to force the numbers within the string's range). Strcat in a loop. Pseudo-code. [code=c]my_letters = "abcdefghijklmnopqrstuvwxyz" /* allowable letters for your random string */ my_random_string /* your random … | |
Re: How are we meant to defend ourselves for the impending alien attacks if we don't enhance ourselves? Thankfully colonies from the future have send back in time 'videos' and 'movies' to train us in such matters. | |
Re: switch( x>y ) { ... } ? | |
Re: Erm. Copy all relivant data? By the looks of it start at the back pointer and iterate to the front pointer assigning the values at each of the nodes (from Q), to your object along the way. | |
Re: [QUOTE]cout << "Enter the grade for Exam 1: "; cin >> 100 //...[/QUOTE] I assume what you want is to have those as the inputs, right? That doesn't work. You can't read in a number like that. What you're going to have to do is read in [I]a variable[/I] and … | |
Re: I'm sure wikipedia will have something of another on the subject - [url]http://en.wikipedia.org/wiki/Hyperbola[/url] | |
Re: >> Nobody can have a house like that. Government won't allow it. Why not? | |
Re: [B]Calvin:[/B] Dad, how do cash machines work? [B]Calvin's Dad:[/B] There's a small man behind the machine and when you say how much you want he posts it out the hole. [B]Calvin:[/B] Oh! Just like the man who opens the garage door? [B]Calvin's Dad:[/B] Exactly It's like that for most automatic … | |
Re: You can point it to the first y position. int *p = numbers[0]; Or whichever one you want. | |
Re: Heh. I don't find it vile but I don't practise the habit either. | |
Re: Well. Regardless of the loop kind (assuming it's allowed to iterate enough times), it should read in the info: [code]while ( in >> word ) std::cout<< word;[/code] Where in is your input file stream and word is something used to store the information of the file. | |
Re: I recommend celebration! What are you doing here? Happy birthday, though. Now you have no excuses to not be unsensable. :) | |
Re: It's a 2-D array, presumably. Start from the top and go along each row and record the position of the first one. Pseudo code: [code]loop y=0, 5 loop x=0, 5 if val of array[y][x] is 1 print (x+1) break loop end loop x end loop y[/code] | |
Re: Dude, I told you to use code tags! One option would be to read the value to a temp string. Test that for "stop". If it is stop assign the new element that value. Else break. Then outside of the loop test that string for "stop" and do what you … | |
Re: So the problem is in sorting the arrays? Look into this - [URL]http://www.cplusplus.com/reference/algorithm/sort.html[/URL] It's the standard sorting method. The example there is numerical but I'm certain it does alphabetical data too. >> if there are less then 20 clients being entered i would like to be able to stop the … | |
|
The End.