CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Neil.Dyke

Search: Search took 0.02 seconds.

  1. Replies
    0
    Views
    3,743

    input_from_file

    Hello,

    Say I have a file with two lines:

    // file
    20 21

    //end of file

    How do I get the numbers into integer variables from the file in an efficient way?
  2. Replies
    2
    Views
    4,202

    Output to file

    Hi,

    Is there a way to output data to a file without erasing its contents?

    Thanks

    Neil
  3. Replies
    8
    Views
    14,538

    Re: String sort in Alphabetical order

    Its only caps.

    so for example i need to sort the string "TEST" to "ESTT".
  4. Replies
    8
    Views
    14,538

    Re: String sort in Alphabetical order

    Do you have some code? I'm lazy ;)
  5. Replies
    8
    Views
    14,538

    String sort in Alphabetical order

    Hello,

    Does anyone have an algorithm or know a function that can sort a std::string for me?

    Say i have:

    string one = "test";

    sorting it alfabetically would result in > "estt"
  6. Replies
    7
    Views
    5,425

    Re: Delete_items_from_string

    Thanks Lindley!
  7. Replies
    7
    Views
    5,425

    Re: Delete_items_from_string

    Sure, here's the code. Its a program that reads a file. The first to lines are int, first int states how many rows there are after the 2 lines that have been read. The second int says how much colums...
  8. Replies
    7
    Views
    5,425

    Re: Delete_items_from_string

    Thanks for your reply, I understand. Would using a std::string in this case be more efficient (as in faster to make)?
  9. Replies
    7
    Views
    5,425

    Delete_items_from_string

    Hi,

    Is it possible to delete certain items from a char sequence or string?
    Say i have:

    char test[5] = {'a','b','c','d','e'};

    Is it possible to delete 'a' for example?

    Thanks!
  10. Replies
    6
    Views
    7,696

    Re: Getline_input_to_int

    Thank you, Lindley. That helped!

    @ Philip, is there a way i can read it directly into int?

    - Neil.
  11. Replies
    6
    Views
    7,696

    Re: Getline_input_to_int

    Thanks for your quick reply, i get an error whilst compiling though.

    Heres my code:
    <code>

    #include <iostream>
    #include <fstream>
    #include <string>
    #include <cstdlib>
    using namespace std;
  12. Replies
    6
    Views
    7,696

    Getline_input_to_int

    Hello,

    Is it possible to convert the input you get from using the getline(inputfile, string) to an int?

    Say i have a file "abcd.txt", with the following content:

    6
    3

    How can i convert...
Results 1 to 12 of 12





Click Here to Expand Forum to Full Width

Featured