#include <iostream>
#include <algorithm>
#include <fstream>
#include <iterator>
#include <string>
#include <vector>
#include <list>
bool strLesser(const std::string &elem1, const std::string...
Type: Posts; User: pliang
#include <iostream>
#include <algorithm>
#include <fstream>
#include <iterator>
#include <string>
#include <vector>
#include <list>
bool strLesser(const std::string &elem1, const std::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)...
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...
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...
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...
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...
I figured out the problem, but thanks you all for the advice :D
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...
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...
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...
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...
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 :)
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...
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...
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,...
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>
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...
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...
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...
Yup, that was the problem :) I hate it when I miscount the array indices :( Thanks!
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'...