August 12th, 2010, 08:25 AM
int i = 0;
cout<< i;
i want to display i as in 000
if my int i = 1, i want it to display 001.
how do i code it so that it works like that?
July 30th, 2010, 07:21 AM
thanks alot monarch, you've been a great help =)
i've managed to read the whole file and print it out using
cout<<lines; now, but i still have a question.
Assuming my files have the words...
July 30th, 2010, 04:46 AM
thanks for reply monarch, the .stx is the extension of the file that i'm supposed to open...
i've included the .c_str() but still couldn't get it working :'(
July 30th, 2010, 03:24 AM
void Lines::load(string filename)
{
string lines;
ifstream inFile;
inFile.open(filename.stx);
if (!inFile)
{
cout<<"error";
}
July 29th, 2010, 09:14 AM
#ifndef LINES_H_INCLUDED
#define LINES_H_INCLUDED
#include <string>
/** @file Lines.h */
typedef string ListItemType;
/** class Lines*/
April 2nd, 2010, 01:47 PM
sry for not being specific...
"a" is actually a vector of strings and "b" is a variable used to store another string that i key in
string getName() {
return name;
}
template <typename A...
April 2nd, 2010, 01:27 PM
i'm currently a student learning programming and i have a part of the for loop where i couldn't get the output as i wanted = (
a[0] = aaa
a[1] = bbb
I'm actually iterating through a vector...