Search found 7 matches

by Kire Sopov
Thu Apr 19, 2007 1:00 am
Forum: Volume 102 (10200-10299)
Topic: 10282 - Babelfish
Replies: 48
Views: 19582

Why do you use that vector variable vm? :o


That's what probably causes the memory overflow.
And btw, you haven't handled the case where the word doesn't exist in the dictionary (you should output 'eh' in that case).
by Kire Sopov
Tue Dec 12, 2006 3:16 am
Forum: Volume 3 (300-399)
Topic: 389 - Basically Speaking
Replies: 94
Views: 22551

389 - CE

Why am I getting a compile error? #include <iostream> #include <iomanip> #include <string> #include <algorithm> void ConvertNum(std::string &str, int nFrom, int nTo) { static const char szDigits[] = "0123456789ABCDEF"; int nValue10(0), nProduct(1); // Convert from base nFrom to base 10: for (std::st...
by Kire Sopov
Mon Dec 11, 2006 5:42 am
Forum: C++
Topic: moduler design with "extern keyword"
Replies: 2
Views: 1819

Doesn't seem to have a problem in VS. I hope you meant "main.cpp" for the name of the file where the main() function is. I compiled it using VC++ 8.0 with default compiler settings. However, the program crashes during runtime. You should change the main file to something like the following: #include...
by Kire Sopov
Sun Dec 10, 2006 2:33 am
Forum: Volume 2 (200-299)
Topic: 271 - Simply Syntax
Replies: 46
Views: 12428

Thank you for the quick reply. I got an AC :)

Anyway, the fix is to just add the line:
else if (nValids == 0) return false;

after this line:
else if (it == ss.end()) return (nValids == 0);

in the function CheckValids() in my previous post.
by Kire Sopov
Sun Dec 10, 2006 1:49 am
Forum: Volume 2 (200-299)
Topic: 271 - Simply Syntax
Replies: 46
Views: 12428

271 - Simply Syntax

What's wrong with this code. I tried so many input cases and it seems to work ok. Are there any special cases I'm missing? [code] #include <iostream> #include <string> #define IsPZ(ch) (((ch) >= 'p') && ((ch) <= 'z')) bool CheckValid(const std::string &ss, std::string::const_iterator it, int nValids...
by Kire Sopov
Sat Sep 18, 2004 5:33 pm
Forum: C++
Topic: Weird problem with debugger in MS visual C++
Replies: 11
Views: 3981

Farqaleet is wrong about something; Namely, in C++, the following two lines are entirely equal: const char *pChar; char const *pChar; whereas char * const pChar; --- is something else :wink: Example: ---------------------------------------------------------------------- [cpp] #include <stdio.h> int ...
by Kire Sopov
Wed Sep 15, 2004 2:05 am
Forum: Volume 3 (300-399)
Topic: 301 - Transportation
Replies: 13
Views: 4872

Here's my code, if it can help... [cpp] /* @JUDGE_ID: xxxxxx 301 C++ "Backtracking" */ #include <stdio.h> #define MAX_ORDERS 25 #define MAX_STATION 10 // Global templates template <class _T> inline void Swap(_T &x, _T &y) { _T z = x; x = y; y = z; } // Global class definitions and typedefs struct TI...

Go to advanced search