Search:

Type: Posts; User: pliang

Search: Search took 0.00 seconds.

  1. Replies
    1
    Views
    1,453

    Trouble sorting a list

    #include <iostream>
    #include <algorithm>
    #include <fstream>
    #include <iterator>
    #include <string>
    #include <vector>
    #include <list>

    bool strLesser(const std::string &elem1, const std::string...
  2. Replies
    2
    Views
    1,486

    Trying to upper case a string

    I know there is a much easier way to do this with a for loop but I am trying to learn the STL algorithms so that's why I am doing this. I have my function like so:


    void Words::UpperCase(void)...
  3. How can I know the actual bytes read in a file read

    I have a file open for binary read as follow

    ifstream fin(inFileName, ios::in | ios::binary);
    fin.read(read_buffer, sizeof read_buffer);


    Is there any way for me to know how many bytes were...
  4. Replies
    4
    Views
    4,226

    Yay, it works now. I knew it was something...

    Yay, it works now. I knew it was something stupid like that, thanks a lot Micko! I got another quest though, why do I have to make my

    unsigned Size(void) const;

    a const member function? I...
  5. Replies
    4
    Views
    4,226

    Class Template Trouble

    I am trying to implement a class template called Array to use with different types, the declaration looks like this:



    #ifndef _ARRAY_HPP_
    #define _ARRAY_HPP_

    #include <iostream> // for...
  6. Replies
    4
    Views
    1,702

    Running Debug in Real Time, possible?

    My combat routine is causing me random crashes and I amwondering if there is anyway I can watch my variables while the program is running in real time. I know I can put break points in debug but...
  7. I figured out the problem, but thanks you all for...

    I figured out the problem, but thanks you all for the advice :D
  8. Problem constructing a class with a nested struc

    I am trying to pass a nested struct type as an argument for the class constructor, and use an initializer list to invoke the implicit copy constructor for the struct to do all the work. But it's...
  9. Replies
    17
    Views
    24,104

    Right now the only known way for me to reduce...

    Right now the only known way for me to reduce flickering is to use the use coordinates to move the cursor around on the screen and update only what I need to, like Bubba mentioned above. I guess...
  10. Replies
    17
    Views
    24,104

    ok, maybe I cannot do it in the same sense as in...

    ok, maybe I cannot do it in the same sense as in a graphical window but something similiar to that effect can be done because I've seen people's console games without the mad flickering that appears...
  11. Replies
    17
    Views
    24,104

    How do I do double buffering in console?

    I got my character moving on my main map but everytime the character moves (or as a matter of fact, anything moves) I do a system("cls") and redraw the entire screen. Thus, I am getting a LOT of...
  12. Replies
    6
    Views
    1,948

    very interesting, I didn't know I can do...

    very interesting, I didn't know I can do arithematic operations on strings, didn't know they overloaded the operators for strings also. I'll have some fun experimenting with that one. Thanks :)
  13. What's the best way to initialize a large const array?

    I have an array that looks like this in my header,



    const char a[100];


    obviously that's too big for me to write out all 100 elements in the header file, I would much rather do it with a...
  14. Replies
    6
    Views
    2,070

    Cool, thanks SirChrono! Now is there a way to...

    Cool, thanks SirChrono! Now is there a way to write over the old string completely with new string or does whatever I add always get attached to the end of the original string? Also what's the...
  15. Replies
    6
    Views
    2,070

    The book I am reading tells me to use...

    The book I am reading tells me to use ostringstream. So instead of
    void FormCombatMessage( stringstream &msg ); I did
    void FormCombatMessage( ostringstream &msg ); Is that a problem? Also,...
  16. Thread: Need loop help

    by pliang
    Replies
    9
    Views
    1,181

    There is a way to make it look more like you...

    There is a way to make it look more like you intended, but it doesn't fix the intrinsic problem just hides it.



    //SomeCrazyGuy
    //'For' Looping Test

    #include <iostream.h>
    #include <stdlib.h>
  17. Replies
    6
    Views
    1,948

    How do I make a string buffer?

    First of all, I apologize if the title is misleading, I don't really know how to describe what I want to do in one line :p . I am working on a text console game. I am having some trouble...
  18. Replies
    6
    Views
    2,070

    How do I make a combat msg buffer?

    The game I am working on is a text console game. I am having some trouble implementing the combat messages. I intend to have 4 lines of combat messages showing on the screen, the newest message...
  19. Replies
    7
    Views
    2,943

    Ya, I noticed I forgot to put in the null...

    Ya, I noticed I forgot to put in the null termination in my array, however, after playing around I found that it was exactly as Micko said, my memory allocation is fine but my array went out of bound...
  20. Replies
    7
    Views
    2,943

    Yup, that was the problem :) I hate it when I...

    Yup, that was the problem :) I hate it when I miscount the array indices :( Thanks!
  21. Replies
    7
    Views
    2,943

    Problem deleting dynamic array

    So I dynamically allocated an array in a simple function and when I tried to free up the memory at the end of the function I got some kind of error during run time. When I removed the 'delete'...
Results 1 to 21 of 21