I would like to know how to reassign standard input/output streams in C++. I'm somewhat new to C++ :roll:
To be exact, i need C++ equivalent (using iostreams) to following C code, which i've been using when submitting programs:
[c]
const char *infile = "101.in", *outfile = "101.out";
char *ibuf ...
Search found 4 matches
- Sun Jul 13, 2003 3:38 pm
- Forum: C++
- Topic: C++ iostreams, reassigning
- Replies: 0
- Views: 1660
- Sun Oct 27, 2002 7:04 pm
- Forum: Volume 1 (100-199)
- Topic: 101 - The Blocks Problem
- Replies: 635
- Views: 108876
- Sun Oct 06, 2002 11:07 pm
- Forum: Volume 1 (100-199)
- Topic: 195 - Anagram
- Replies: 242
- Views: 58276
#195
Yes, case matters in this problem. The correct sequence goes as AaBbCc..... and so forth.Correct me if i'm wrong but 195 has both upper case and lower case.
- Wed May 01, 2002 5:47 pm
- Forum: Volume 4 (400-499)
- Topic: 499 - What's The Frequency, Kenneth?
- Replies: 93
- Views: 20701
Re: Q499
I don't write C++ but there seems to be a problem with your for cycle -
cin.getline(line,500);
for (i=0; i < 500;++i){ <-- should be (i = 0; i < strlen(line); ++i)
switch (line ) { blaah... }
}
Easiest way to solve problem 499 would be to create an array - for example
int frequencies[256], and ...
cin.getline(line,500);
for (i=0; i < 500;++i){ <-- should be (i = 0; i < strlen(line); ++i)
switch (line ) { blaah... }
}
Easiest way to solve problem 499 would be to create an array - for example
int frequencies[256], and ...