--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1I00004 Date: 01/12/98 From: MICHAEL RATHBURN Time: 06:41pm \/To: ALL (Read 1 times) Subj: sort algorithm Hi All , hope you are having a nice day Can someone explain how this sort works I have tried to follow it but I just get confused. /* (SORT.CPP) /* ********************************************************** * sort.cpp * * Ian M Wilks 10/4/94 * ********************************************************** */ #include void main() { const int MAX = 10; int table[MAX]; cout << "\n\n\tThis program demonstrates sorting array " << "elements into\n\tdescending order\n\n" << "\tEnter ten integers: "; for(int i = 0; i < MAX; i++) cin >> table[i]; cout << "\n\n\tThe unsorted array is: "; for(i = 0; i < MAX; i++) cout << table[i] << " "; //sort int temp, test = 0; this is the confusing part :- while(test == 0) { test = 1; for (i = 0; i < (MAX - 1); i++) { if (table[i] < table[i + 1]) { temp = table[i]; table[i] = table[ i + 1]; table[i + 1] = temp; test = 0; } } } cout << "\n\n\tThe sorted array is: "; for(i = 0; i < MAX; i++) cout << table[i] << " "; }*/ -=> Yours sincerely, Michael Rathburn <=- ... "I drink beer, but not from bottles", Tom said cannily. ~~~ Tag-O-Matic V.13 ! I recognise the Green Frog. --- Terminate 5.00/Pro * Origin: Have you ever been TERMINATEd ? (2:250/124.19) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1I00005 Date: 01/14/98 From: KURT KUZBA Time: 02:48am \/To: ALEXEY MOKHOV (Read 1 times) Subj: SCREEN BLINKING AM> Can I spoil something and call AM> unintentionally the screen repaint? I'm not familiar with OWL. In MFC, however, the Invalidate() command will initiate the OnDraw message, and it can use two states, TRUE and FALSE, with TRUE being the default. If the condition is TRUE, then a total rewrite of the window is performed, blanking it first. This is the default for when you move or resize your window, naturally, but when you are only updating a valid display, you want to use FALSE. Perhaps there is something similar in OWL, where it will not blank the window before redrawing it. > ] The Sky is full of Good and Bad that Mortals Never Know..... --- * Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1I00006 Date: 01/14/98 From: KURT KUZBA Time: 02:48am \/To: ANTHONY TIBBS (Read 1 times) Subj: DOS border/window librar AT> It appears that your message(s) have been lost in space. AT> At least, I never received them? I'm going to add a listbox and repost it. > ] Well, I wasn't expecting the Spanish Inquisition!........... --- * Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1I00007 Date: 01/13/98 From: DARIN MCBRIDE Time: 05:55pm \/To: LEE BRAIDEN (Read 1 times) Subj: Persistant Objects (If that's the right 17:55:0401/13/98 LB> I'm looking for different ways to do persistant objects... at least I hope LB> that's the correct term. Basically, I just want objects that can load and LB> save themselves. The saving bit's easy, but doing LB> Object *loaded = load_Object(fname); Have you taken a look into how Java accomplishes the same thing? That might become very informative. --- * Origin: Tanktalus' Tower BBS (1:250/102) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1J00000 Date: 01/13/98 From: VICTOR KEMP Time: 08:05pm \/To: ALL (Read 1 times) Subj: converting char to string Hi, how do you convert a char to a string? I would like to concatenate a single char onto the end of a string but it says it can't convert int to char * when I do this: char charvar; char stringvar[90]; strcat(stringvar, charvar); I also tried doing: strcat(stringvar, (char *)charvar); but that made a big mess of things although gave no error message. --- Maximus 3.01 * Origin: The Ultimate (3:771/340) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1J00001 Date: 01/14/98 From: BOB STOUT Time: 08:23am \/To: AUKE REITSMA (Read 1 times) Subj: moderation and the echos On , Auke Reitsma (2:281/400.20@fidonet) wrote: RS> 4. Reuninfication must be approved by *both* echos. If either votes it RS> down, > Timing problem. Voting in the C_echo will be in february. If I'm right > then C_plusplus will be dead waiting for those votes. > Suggestion: vote NOW. Auke... To quote Emily Littela, "Nevermind." (Old SNL/Gilda Radner reference.) It appears that one of my messages was handled properly by the Elist robot and that I'm now listed as the C_PLUSPLUS moderator. This means that the 31-Jan dealine doesn't really exist, so the two echos can vote at the same time. I'll therefore repost your election rules here for C_PLUSLPUS later today. --- QM v1.00 * Origin: MicroFirm : Down to the C in chips (1:106/2000.6) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1J00002 Date: 01/14/98 From: BOB STOUT Time: 08:31am \/To: JONATHON DE BOYNE POLLARD (Read 1 times) Subj: moderation and the echos On , Auke Reitsma (2:281/400.20@fidonet) wrote: > I nominate Jonathan de Boyne Pollard, Tom Torfs and Roger Scudder. Jonathan... You have been nominated for C++ echo moderator. If you are able to accept this nomination and are willing, please reply both here in the echo and to rbs@snippets.org. --- QM v1.00 * Origin: MicroFirm : Down to the C in chips (1:106/2000.6) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1J00003 Date: 01/14/98 From: BOB STOUT Time: 08:31am \/To: ROGER SCUDDER (Read 1 times) Subj: moderation and the echos On , Auke Reitsma (2:281/400.20@fidonet) wrote: > I nominate Jonathan de Boyne Pollard, Tom Torfs and Roger Scudder. Roger... You have been nominated for C++ echo moderator. If you are able to accept this nomination and are willing, please reply both here in the echo and to rbs@snippets.org. --- QM v1.00 * Origin: MicroFirm : Down to the C in chips (1:106/2000.6) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1J00004 Date: 01/14/98 From: JOHN DUMAS Time: 02:53pm \/To: BOB STOUT ET AL (Read 1 times) Subj: the echos and a real ques I lurk in both echos and have been influenced by snippets, as I have been learning more and more I can see why the C people want to keep C ansi pure, ansi with no extentions is almost a montra there, I never subscribed to that, as thier reason seems to be portabillity, which even if that Holy Grail could be achieved, I would find it to constraining to have to look up the ansi way when a perfectly good function is readily available. I for one use dlls as a way to use my C code in other languages. So much for purity, when the choice is rewriting. Question: I have been using C++ Win32 dlls in my visual basic programs. Lets say that I retval=Shell("c:\windows\notepad.exe,3) SendKey("try this") "In visual basic this starts a child program and sends keystrokes to it" I cannot find a way "yet" in VB to read text from the shelled program. Could anyone point me in the right direction of a way to get text from the "retval" program. If you have a VB way of doing it please netmail me or email at johnjd@worldnet.att.com If you have an on topic C++ way I will check back here each day. But, I still would not mind a little mail. ... I fear explanations explanatory of things explained (A.Lincoln) --- Blue Wave/DOS v2.20 [NR] * Origin: The Witch City BBS *Salem,MA [978]745-1689 *Hayes 28.8 (1:101/301) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1J00005 Date: 01/14/98 From: BOB STOUT Time: 02:52pm \/To: ALL (Read 1 times) Subj: Echo reunification Since we're currently discussing it, I suggest everyone try to find a copy of the current "C/C++ Users Journal" which has several columns devoted to the way C and C++ seem to be diverging. While C++ started out as an improper superset of C, the current draft standards seem to be committed to further severing the umbilical. IMHO, the arguments for and against reunification of the C and C++ echos boild down to: FOR: Dwindling FidoNet activity suggest consolidation. Many programmers use both C and C++. Many tyros don't know the difference. AGAINST: The language standards are growing apart. Topic clutter. Confusion. Since we now have moderator candidates in both echos, the threat of the C++ echo simply evaporating has itself evaporated for the time being. Therefore, my personal preference is to continue as separate echos for the immediate future (or at least until new standards are adopted and we can all see how much common ground is left). I do agree with Auke's previous suggestion that the balloting for echo reunification be held in advance of the moderator election. --- QM v1.00 * Origin: MicroFirm : Down to the C in chips (1:106/2000.6)