parsess < /dev/null
.
parsess < parsess
.
parsess 0, ,0 2-1,0 100,100
.
char *
abuse tests.
100 | 200 | 300 | 400 | 500 | |
---|---|---|---|---|---|
0 | 1 | 1 | |||
10 | 2 | 1 | |||
20 | 2 | ||||
30 | 1 | 1 | |||
40 | |||||
50 | |||||
60 | 1 | 1 | |||
70 | 3 | 1 | |||
80 | 1 | 1 | |||
90 | 1 | 1 | 1 | ||
Totals | 1 | 6 | 3 | 8 | 2 |
000 | 100 | |
---|---|---|
0 | 2 | |
10 | 1 | |
20 | 2 | |
30 | 3 | |
40 | 2 | |
50 | ||
60 | 4 | |
70 | 1 | 2 |
80 | ||
90 | 3 | |
Totals | 1 | 19 |
total | pages per procedure | |||||||
---|---|---|---|---|---|---|---|---|
procs | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
2 | 1 | 1 | ||||||
2 | 1 | 1 | ||||||
2 | 1 | 1 | ||||||
3 | 1 | 1 | 1 | |||||
4 | 2 | 1 | 1 | |||||
4 | 2 | 1 | 1 | |||||
6 | 4 | 1 | 1 | |||||
9 | 4 | 4 | 1 | |||||
9 | 6 | 2 | 1 | |||||
10 | 4 | 5 | 1 | |||||
11 | 5 | 3 | 2 | 1 | ||||
11 | 8 | 2 | 1 | |||||
13 | 10 | 3 | ||||||
15 | 11 | 3 | 1 | |||||
16 | 13 | 2 | 1 | |||||
17 | 16 | 1 | ||||||
$ parsess < /dev/null Invalid Input $
$ parsess < /dev/null Requires minimum one argument .... $
$ echo aaaa bbbb | ./parsess 0,0 0,1 aaaa bbbb $
mains()
int main(int argc, char* argv[]) { get_ss_text(); compute_columns(); find_ss_cells(argc, argv); return 0; }
char local_argv[25] for (p = 1; p < argc; p++) { strcpy(local_argv, argv[p]) // whatever }
string str char ch[200] while(true) { if (!cin.eof()) { cin.getline(ch, 200, '\n') str = ch // whatever. }
This code fails for 200+ character input lines.
What possible explanation is there for code like this?
string str while (getline(cin, str)) { // whatever }
if (r_bstr[i] < 48 || r_bstr[i] > 57)
48? 57? What are these? Are you sure?
if (str1[loc] == 32) // 32 is ASCII char sp
Oh? Is everything ASCII?
char ch[200] while cin.getline(ch, 200, '\n') ... f(200) ...
Have you changed all proper values?
Have you left alone all other values?
while !cin.eof() getline(cin, s ) if (s.size() != 0)
while true if !cin.eof() getline(cin, line)
while getline(cin, s) // whatever
while getline(std::cin, s) if std::cin.eof() break
while cin.good() && !cin.eof() && cin.get(ch) if EOF == ch break
good()
implies !eof()
.
ch
is not set to EOF.
if cin.peek() == EOF exit(-1) while !cin.eof() if cin.peek() == EOF break getline(cin, spread)
if (len < recLen) for (int j = 0; j < (recLen - len); j++) line = line + ' ';
This is complicated, expensive, and slow.
space = ss_vec[j][k+1].length - ss_vec[j][k].length; (ss_vec[j][k].cell).append(space, ' ');
This is not.
$ echo aaaa bbbb | parsess 0,0 first_row = 0 last_row = 0vs[0] = aaaa bbbb ! Out of range spec $
$ parsess < /dev/null No Element-Specs supplied. Nothing to do... ...Doing nothing. ba'Bye $
This page last modified on 26 September 2002.