Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by SpeakerForTheDead

  1. SpeakerForTheDead

    Problems with cin.getline

    I figured it out. I was using "/n" instead of endl and that was screwing up cin.getline and getch Now I've got a few more problems, but those should be easy. Just one question. How can you determine if a file already exists? The function always returns that that the file exists...
  2. SpeakerForTheDead

    Don't use gets

    I've heard often that one should never use gets. I've been told to use cin.getline instead. Does anyone know if gets could seriously mess up one's compiler if used frequently?
  3. SpeakerForTheDead

    Problems with cin.getline

    I'm sorry. There's probably nothing wrong with cin.getline. The same thing is happening with getch. It's something SERIOUSLY wrong with my compiler. I'm going to try reinstalling it.
  4. SpeakerForTheDead

    Problems with cin.getline

    I'm trying to write a program that frequently prompts for char arrays. I've been told to stay away from the gets function. Yet when I run the progam, it does something very strange. It skips the cout command that precedes it and then displays the text AFTER the prompt. And there are other...
  5. SpeakerForTheDead

    How Can You Manipulating Strings In Older C++ Versions?

    Still not working. It compiles and executes, but it does very weird things... Please help. #include <iostream.h> #include <stdlib.h> #include <conio.h> #include <stdio.h> #include <string.h> #include <fstream.h> void get(char prompt[100], char input[100]) //get(prompt, variable); {//get -...
  6. SpeakerForTheDead

    How Can You Manipulating Strings In Older C++ Versions?

    Thanks. Most of that was very helpful. However, I can't figure out how to copy a string starting in the middle of the string. With .assign, it's easy, you just enter where you want the copying to start. I haven't found a function (or a sequence of functions) in <string.h> that will allow me...
  7. SpeakerForTheDead

    How Can You Manipulating Strings In Older C++ Versions?

    Okay. I'm used to using Microsoft Visual C++ v6.0, but I have v4.0 at home. I'm used to adding strings the way you'd add numbers. I'm used to using string.assign() and string.find() for all of my purposes. But I can't use them any more. So I was wondering what tools for manipulating strings...
  8. SpeakerForTheDead

    How do you use strings in old C++?

    Ha! Never mind! I DON'T use it! Simple as that! What does c_str() do, anyway? The syntax I use it in is fin.open(string.c_str()) note: fin is the ifstream command I use
  9. SpeakerForTheDead

    How do you use strings in old C++?

    char arrays work. But there's a function that I use frequently for loading files: c_str() How would I use that?
  10. SpeakerForTheDead

    How do you use strings in old C++?

    I haven't tried the char array yet. And <string.h> is missing something. It doesn't recognize strings!
  11. SpeakerForTheDead

    How do you use strings in old C++?

    If only it was so simple. <string> does not exist in C++ v4.0. And using namespace std; is automatically built in so if you try to use it, it'll give you an error message.
  12. SpeakerForTheDead

    How do you use strings in old C++?

    Okay. I have C++ 4.0 at home and I can't get strings to work. From what I've heard, this because at the time 4.0 came out, string wasn't &quot;standard.&quot; At first I thought this had to do with the header files I was using. But does it have something to do with namespaces? Do I have to...
  13. SpeakerForTheDead

    #include files

    As long as we're semi- on the subject, what is the older (say... 4.0) version of the header file <string>? Not <string.h>. Just plain <string>.
  14. SpeakerForTheDead

    Translating A Program from 6.0 to 4.0

    Alright. I'm at school. string and string.h are two COMPLETELY different header files. My home computer doesn't have string (tho I suppose I could take it home). So that's probably the problem. Does ANYONE know what header files I'd need to do the same thing as &quot;string&quot;?

Part and Inventory Search

Back
Top