--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EEC00005 Date: 10/07/97 From: DARRELL HNIZDOR Time: 01:49pm \/To: ALL (Read 2 times) Subj: cin.getline I have a problem with cin.getline using Borland C++ Below is a copy of a function which works fine until referenced within a WHILE loop, then the cin.getline doesn't execute, however, if I put two identical lines it does execute. The problem also occurs with other string input functions. int addrec() { studentData student; int cnt = 0; while (cnt == 0) { cout << "Add record" << endl; cout << "Name: " ; cin.getline(student.name,30); cout << student.name << endl; char *s1 = student.name; //looks for cr char *s2 = ""; int st; st = strcmp(s1,s2); if (st == 0) cnt = 1; } return 0; } --- Maximus 3.01 * Origin: Friendship Corner Albany, Tx 1-915-762-2745 (1:392/15) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EEC00006 Date: 10/05/97 From: DANNY KEOGH Time: 08:34am \/To: ALL (Read 2 times) Subj: Code translation Ok peoples, I need a little help from those of you who know pascal. I need the pascal statement memW[$0000:$041C] := MemW[$0000:$041A]; translated into C. That line flushes the keyboard buffer. If there's a better way to do it, please let me know. Thanks in advance Visit The Furball's Laire by pointing your favorite web browser at http://www.strug.com.au/~furball EMAIL: FURBALL@STRUG.COM.AU "The fur will be with you, always." ... If you offr me a mouse I would rather have a rat.... --- FMail/386 1.02 * Origin: Enterprise BBS, Melbourne, Aust, +61-3-9776-7089 (3:632/158) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EEC00007 Date: 10/07/97 From: SHANE DAY Time: 11:32pm \/To: PAUL WANKADIA (Read 2 times) Subj: Re: OS? PW> If any of your members are interesting in defecting to Australia to help me PW> write an OS, book your tickets now to avoid the Christmas rush. What type of OS? GUI/Text? --- Renegade v5-11 Exp * Origin: Cranial Disturbance (613)723-9841 (1:163/572) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EEC00008 Date: 10/05/97 From: RORY STREET Time: 03:00pm \/To: WAYNE SCHROEDER (Read 2 times) Subj: Re: Java++ In a message of <24.09.97>, Wayne Schroeder (1:280/191) writes: By Jupiter! It's Wayne Schroeder! RS>> This is the only echo I could find close to taking about Java RS>> Iwonder can help. The company I am working for wishes to design its RS>> web pages completely with Java. That means, that for animations no RS>> animation called in its all done in the Java code to make it faster. RS>> Does special routine I can use in Java for this? WS> The JDK from sun comes with some animation examples... oh.. and WS> another thing.. hehehe.. the animations would be faster if animated WS> gifs were used.. the java code would be way slower. Some instances WS> it may be better to use java code yes.. but for the most part.. it is WS> much slower. There are Java and Web related fido echos also.. I am WS> guessing you don't have those on the system you get fido from do WS> you? I don't think so I will check my Fido echo's docs.. I have just seen Microsoft are giving away visual Java with a book for 28 pounds over here on CD so I think I will buy that. The animations we are doing are quite long ones not just the odd 20 frames I suppose. But then again there is a problem of loading up long web pages with the heaps of Java commands.. Cya! Rory Street --- IOS-Mail 0.91pl9 eta * Origin: >>>> Athena BBS +44-(0)-1959-563-968 (2:440/226@fidonet.org) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EED00000 Date: 10/08/97 From: FRANK MASINGILL Time: 02:06pm \/To: ALL (Read 2 times) Subj: Error showing data Either there is some error I'm stupidly overlooking or some quirk in this program code. If I took out all references to the fifth item in the tructure it would show the two characters for the State at the end and finish. But, s it is you can see that following the two character State name this program will immediately continue with the characters of the zip code and then also put in the zip code on the next line. I'm compiling on a 486/133 with Borland version 3.0 compiler. What is causing this? Many thanks in advance. I know my face will be red when I learn why. //DATABASE.CPP - playing with char data items #include #include #include #include class database { private: char name[20]; char address[20]; char city[10]; char state[2]; char zip[10]; public: void getdata(char n[], char a[], char c[], char s[], char z[]) { strcpy(name,n); strcpy(address,a); strcpy(city,c); strcpy(state,s); strcpy(zip,z); } void showdata() { cout << "Name = " << name << '\n'; cout << "Address = " << address << '\n'; cout << "City = " << city << '\n'; cout << "State = " << state << '\n'; cout << "ZipCode = " << zip << '\n'; } }; main() { clrscr(); database d; d.getdata("Sam Jones","SomeStreet", "SomeCity", "SS", "33333-2222" ); d.showdata(); return 0; } Sincerely, Frank --- PPoint 2.05 * Origin: Maybe in 5,000 years - frankmas@juno.com (1:396/45.12) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EED00001 Date: 10/06/97 From: KNUT SCHUENEMANN Time: 02:45am \/To: ALL (Read 2 times) Subj: C++Builder Error Does anyone know how to avoid the 'cannot create map file:'-error? Knut --- Yuppie v2.11 * Origin: The Stoned Ghost (2:2437/120.5) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EED00002 Date: 10/08/97 From: GERRY DANEN Time: 09:21pm \/To: FRANK MASINGILL (Read 2 times) Subj: Error showing data FM> Many thanks in advance. I know my face will be red when I learn FM> why. FM> class database FM> { FM> private: FM> char name[20]; FM> char address[20]; FM> char city[10]; FM> char state[2]; FM> char zip[10]; Make state[3]... for the terminating null. Gerry Danen (gdanen@accessweb.com) C+Net BBS @ 403-477-9545 http://www.geocities.com/SiliconValley/Way/9823 2 years, 84 days, 2 hours, 48 minutes, and 16 seconds until January 1, 2000. --- Maximus 3.01 # Origin: C+Net BBS. Programming & Networking. (111:1403/2) * Origin: Alberta Genealogy BBS (1:342/5013) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EED00003 Date: 10/08/97 From: JAMIE KOWINSKY Time: 08:06pm \/To: ALL (Read 2 times) Subj: Char[] Strings I used to program in C and used an array of chars for strings, Now I'm using C++ and find that strings are now a class with shinny new operations to preform on them. However I have a few questions about using the old C style strings in C++. For various reasons there are times when I need to use an array of chars for a string. Can I safely use cin on it? for example, is cin << somestring; safe? By safe I mean that The array has to have a null char in it to terminate it. If the char array is 5 elemets and someone types in a huge string what will happen? I'm assuming since cin doesnt know the size of my array that it will just write all thoese bytes over whatever happens to be in memory after the array of chars. Also, I need a bit of a refresher course with char array strings, One point I can't quite remember is the max length of a string that can be entered into n arary of a given size, is it size-1? For example, if an array has 3 elements (0-3) I cannot store "the" as there will be no null character, but "hi" is ok as it would be "Hi"+nullch (3 elements) thanks for any info you may be able to provide. Prehaps theres a FAQ for something like this? l8tr -Jam ... Has anybody seen my tagline? It about 70 characters long and sarcastic. --- FMail/386 1.02 * Origin: KastlerocK + Jeannette, PA + 412.527.3749 (1:129/230) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EEE00000 Date: 10/07/97 From: MICHAEL RATHBURN Time: 07:23pm \/To: ALL (Read 2 times) Subj: pcplus Hi All , hope you are having a nice day Just a short note to say october's edition of PcPlus had the full version of Borland C++ 4.5 compiler come ide on one of the cover cd's . -=> Yours sincerely, Michael Rathburn <=- --- Terminate 5.00 UnReg * Origin: With Terminate YOU can beat the feeling! (2:250/124.19) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EEE00001 Date: 10/08/97 From: MIKE WES Time: 07:48pm \/To: ALL (Read 2 times) Subj: How to convert a AnsiString to an intege19:48:5210/08/97 Hallo All Hello, Has anybody an idea how I can convert an AnsiString S (containing numbers) to a long? I captured the value out of an edit value. Regards, Mike Wes Groeten, email : Mike.Wes@inter.NL.net |\/| fido : 2:283/708.47 | |ike \/\/es --- F.I.P.S./32 v0.96 Win95/NT [M] * Origin: Happiness is seeing your boss's face on a milk cartoo (2:283/708.47)