447 Posted Topics

Member Avatar for hashinclude

Or if you don't want the whole screen to clear, only the line with the number on it:[code]for ( int i=0; i<100; i++ ) { std::cout<< "\r" << i << "\t"; Sleep( 100 ); }[/code] \r goes to the start of the line, assuming you're printing to the start of …

Member Avatar for Ancient Dragon
0
98
Member Avatar for twomers

Who doesn't like a good quote from time to time? Anyone got any good ones? I like this one from Contact: First rule in government spending: why build one when you can have two at twice the price? Man, that movie's over ten years old now... weird.

Member Avatar for vmanes
0
276
Member Avatar for teppuus

Wrap your code in code tags [noparse][code][/code][/noparse], but put in a language specifier, like so: [noparse][code=c]CODE GOES HERE[/code][/noparse] or [noparse][code=cpp]CODE GOES HERE[/code][/noparse]. The latter gives:[code=cpp]CODE GOES HERE[/code]

Member Avatar for teppuus
0
82
Member Avatar for iamthwee

The simplest thing I can think of is to use some kind of pop3 library... I'm sure there are probably some available. ( first hit -- [url]http://www.marshallsoft.com/see_4c.htm[/url] No idea on how good it is ) If not I reckon you should be able to do something with libcurl ... I'm …

Member Avatar for iamthwee
0
328
Member Avatar for Jessyi
Re: help

I'm glad you put in the last line in the thread. But I, for one, would like to see some work before helping. Just to see where you are so the advice I'm giving isn't redundant.

Member Avatar for Ancient Dragon
0
239
Member Avatar for renaad

>> gets(p->name); Bad. Seeing as you're using C++ (noticable only from the *& in [inlinecode]insert[/inlinecode]), you can use [inlinecode]std::getline[/inlinecode] and [inlinecode]std::string[/inlinecode]s. Also in C++ one does not need to [inlinecode]typedef[/inlinecode] [inlinecode]struct[/inlinecode]s. >> main() [inlinecode]main[/inlinecode] returns in int: [inlinecode]int main()[/inlinecode]. Also, good idea not to allow the users to quit.

Member Avatar for renaad
0
262
Member Avatar for lasher511

Ever wonder why there aren't any babies in the north during the winter, vegaseat? My experience was much like what you'd expect Atticus Finch to say. And I was more confused after asking. I asked, as far as I remember, cause there was a big rape case on the news …

Member Avatar for sneekula
0
276
Member Avatar for uniquestar

I'm kind of ambidextrous. I've been taking notes in class with my left hand for the last... 4 months. I'm not certain why, but I am certain that when it comes to exam time I'll curse the day I decided that was a good idea.

Member Avatar for scru
0
151
Member Avatar for antlu

>> scanf("%c%c%c%c",&a,&s,&d,&f); >> if ((a=='a')&&(s=='r')&&(d=='c')) >> else if ((a=='l')&&(s=='i')&&(d=='n')&&(f=='e')) I'm guessing you don't know about using character arrays then? Take a look [URL="http://www.cplusplus.com/reference/clibrary/cstring/"]here[/URL]. Ones to note are [URL="http://www.cplusplus.com/reference/clibrary/cstring/strcmp.html"]strcmp()[/URL] and look into scanf-fing with[inlinecode]%s[/inlinecode]. >> system(); What's that there for? >> for(yf==yl1;yf<=yl2;yf++) The first parameter in a for loop is meant …

Member Avatar for antlu
0
92
Member Avatar for k2k

Not certain why you had to start another thread either. Basically the same problem as [URL="http://www.daniweb.com/forums/thread105141.html"]last time[/URL].

Member Avatar for twomers
0
129
Member Avatar for k2k

With the architecture you provided you don't need any set member function. You can access the variables by using . [code]class Name { private: int id; string lastName; string firstName; string phone; double amt; public: void output(); void set(int, string, string, string, double); };[/code]I believe is what you were meaning? …

Member Avatar for k2k
0
232
Member Avatar for Clascli

Easiest thing to do, from experience, is to download [URL="http://www.videolan.org/vlc/"]VLC Media Player[/URL] and read up about its networking functionality.

Member Avatar for twomers
0
84
Member Avatar for invisal
Member Avatar for Xsimulator.net
Member Avatar for Narue

This was asked in another forum I go to and I came up with the following: [B]Reading contents of a file directly to a vector[/B][code=cpp]#include <fstream> #include <vector> #include <string> #include <algorithm> int main( void ) { std::ifstream in( "shorts.txt", std::ios::binary ); if ( in ) { std::vector< short > …

Member Avatar for bector
2
8K
Member Avatar for lifei

You should post some code to show us that you've tried something. Generally we're a lot more helpful if we see some effort...

Member Avatar for lifei
0
126
Member Avatar for Chaky1

Found a floppy with [URL="http://en.wikipedia.org/wiki/Battle_Chess"]Battle Chess[/URL] on it the other day. After searching for a drive for it I copied it to my computer and it works. I've been playing nothing but that.

Member Avatar for Serunson
0
277
Member Avatar for zandiago
Member Avatar for sneekula
0
455
Member Avatar for Sawamura

I really don't know what you mean. Do you want to save integers to file? Binder?

Member Avatar for Jx_Man
0
218
Member Avatar for ithelp

I find it infinitely annoying... and I can't get it out of my head... It's like a very well designed advert. I heard that they are [I]meant[/I] to annoy you... I probably wouldn't hire that guy from that CV. I just couldn't take him seriously, you know.

Member Avatar for jaepi
0
136
Member Avatar for sana_akram

[code]#include <cstdlib> int main( void ) { system( "dir>output.txt" ); return 0; }[/code]

Member Avatar for WaltP
0
108
Member Avatar for Lardmeister

I'm not certain but I know that a new kind of solar panel was invented recently which makes solar energy as cheap as coal to buy. Good quality panels have been really expensive up to now. It's not the cost you want though, Dave. I can buy [I]loads[/I] of one …

Member Avatar for sneekula
0
302
Member Avatar for tehprince

You won't read in a sentence with "cin>>". Use [code]#include <string> //... string str; getline( cin, str);[/code]Plus the a you used is an integer... >> struct letteroccurance >> { >> char letters[]; >> int occurance[]; >> }; That won't do. Just make the counter 26 elements wide... You don't need …

Member Avatar for VernonDozier
0
150
Member Avatar for mrjoli021
Member Avatar for mrjoli021
0
109
Member Avatar for omeralper

Do you know how to write one for a terminated list? It's not all that bad. At the root just set the 'previous' to NULL, and set previous->next to NULL and go through it until you reach NULL. Alternatively you could use auto_ptrs or something.

Member Avatar for twomers
0
150
Member Avatar for deicer
Member Avatar for tehprince
0
111
Member Avatar for scru

I'm normally placid. Not sure if any of the above actually offend me ... just annoy me. >> I think face-sucking in public is offensive Why? This reminds me of a quiz I was at before. There was a question about the irrational fear of clowns and I was thinking …

Member Avatar for ZZucker
0
227
Member Avatar for Ancient Dragon

Burn for cheap heating? I haven't been programming that long and only have... well no books... Generic presents to people you don't like.

Member Avatar for Narue
0
105
Member Avatar for nse

Well, this is heavily dependant on your OS and compiler.. this works in XP and MSVC .NET 03: [code=c]#include <windows.h> #include <Iphlpapi.h> #pragma comment ( lib, "Iphlpapi.lib" ) static void GetMACaddress(void) { IP_ADAPTER_INFO AdapterInfo[16]; // Allocate information // for up to 16 NICs DWORD dwBufLen = sizeof(AdapterInfo); // Save memory …

Member Avatar for CrazyDieter
0
203
Member Avatar for bis student

[code]void foo( int val ) { val = 1; }[/code][code]void foo2( int &ref ) { ref = 1; }[/code]First is by value, second is by reference. You can change the value of 'ref' in foo2 by setting its value and the value will change outside the scope of the function, …

Member Avatar for twomers
0
128
Member Avatar for Karkaroff

I'm pretty sure you're making that up, or at least mistaking it. Do you have a cin.ignore() or cin.get() or something before the function is called? Also, you should use std::string to read in the file and getline(). It makes it much easier... Also work with lines rather than characters. …

Member Avatar for Karkaroff
0
310
Member Avatar for todd.sifleet

Use [inlinecode]std::stringstream[/inlinecode] or [inlinecode]using namespace std;[/inlinecode] Stringstreams are part of the [inlinecode]std[/inlinecode] namespace. Dragon just forgot to insert it (old age, you know ;))

Member Avatar for Ancient Dragon
0
207
Member Avatar for jacques95
Member Avatar for The Dude

You're wrong, Dude. Red all the way! I had an amazing one with an amazing steak a few months back. It was then that I discovered that the more you pay for wine the nicer it actually gets! I honestly never tasted the difference before. But red. I'm sure if …

Member Avatar for sneekula
0
216
Member Avatar for phalaris_trip

>> So is there any way I can get rid of the initial argument? You could just make it a friend function ... [code=cpp]template< typename mis_type > class missle_man { protected: std::vector<mis_type> vms; public: template< typename mis_a, typename mis_b > friend bool is_coll( const mis_a &missle_a, const mis_b &missle_b ); …

Member Avatar for twomers
0
238
Member Avatar for The Dude

I dunno... when I was a kid (R are like 18+, right), I used to like watching those films cause I thought it made me ... more ... cooler, or something. Then when I became old enough to watch them ... meh. They lost their appeal. Now I just watch …

Member Avatar for zandiago
0
119
Member Avatar for pavitragupta
Member Avatar for The Dude

I voted yes, but not recently! The last time I remember doing it was when I was 13. I was in a French grammer test and I hated French. I learnt those LORT/Hobbit runes for it especially and wrote the French-equivalent on my school bag! It was premeditated cheating which …

Member Avatar for invisal
0
363
Member Avatar for BalaKrish

Is the data formatted as above? With each signal on a new line? It should be easy enough to parse then... How many time stamps are there?

Member Avatar for BalaKrish
0
109
Member Avatar for evilwrench1975

>> hey, don't underestimate my colleagues! I take it you know that the Irish secret-intelligence is so secret that not even the government knows about it, right? >> I won't embarrass the unit or the female Lance Corporal involved by naming names i.e. a "close aid to the president", i.e. …

Member Avatar for Jishnu
0
163
Member Avatar for corneliu9d

Well, by playing with the code from the link I got this: [code] #include<windows.h> #include<stdio.h> #include<conio.h> #pragma comment(lib, "Winmm.lib") //command, note, velocity #define MAKE_MSG(X, Y, Z) (X + (Y<<8) + (Z<<16)) #define NOTE_ON 0x90 #define NOTE_OFF 0x80 int main(void){ HMIDIOUT x; if(midiOutOpen(&x,-1,NULL,NULL,CALLBACK_NULL)!=MMSYSERR_NOERROR ){ printf("ERRORS ahoy\n"); } midiOutShortMsg(x, MAKE_MSG(NOTE_ON, 62, 65)); …

Member Avatar for corneliu9d
0
173
Member Avatar for sneekula

>> Wow, 6 foot tall and weighig 133 pounds, that is rather skinny. I am 6 foot 3 inches and weigh close to 200 pounds. So one inch is about 22 pounds... I am 5 10/11 ish... so I'm 1573 pounds... that's not right.

Member Avatar for twomers
0
272
Member Avatar for Ene Uran

>> I like Salem's too. Very original and thought provoking Yeah. I've been meaning to borrow that for another programming (embedded device), forum where one uses "void main()". Thought it would be amusing. Hehe. Google-image search "Salem" for small pictures. Daniweb is the first hit.

Member Avatar for sneekula
1
262
Member Avatar for Serunson

I thought it was a good idea to go for a swim at the stroke of midnight... but apparently I have a cold now, so maybe not. Then I went for another on the 26th... Seems to have cured the first one but I have another now...

Member Avatar for Serunson
0
163
Member Avatar for The Dude

At home, then to a friends for whiskey, then to the sea for a cold swim, and then more hot whiskey... or port.

Member Avatar for sneekula
0
163
Member Avatar for The Dude

I like cigars cause I'm pretentious. Also brandy goes nice with them.

Member Avatar for Ezzaral
1
158
Member Avatar for mmonaco27

Is there any way you can keep track of the current position? If there is you can multiply that by two because, as you stated, you know you can't multiply the pointer by two. However, one can do multiplication via addition.

Member Avatar for mmonaco27
0
296
Member Avatar for GrimJack
Member Avatar for use4d

While I agree with ye I also agree with MacBeth: "Who can be [URL="http://www.selfknowledge.com/108260.htm"]wise[/URL], amaz'd, temperate, and furious, Loyal and neutral, in a moment? No man:"

Member Avatar for jasimp
0
436
Member Avatar for The Dude

The End.