Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
Ranked #4K
~6K People Reached
Member Avatar for kevintse

[CODE]#include <iostream> using namespace std; const char* foo() { return "Hello"; } const char* bar() { const char* s = "world"; return s; } void print(const char* s) { cout << s << endl; } int main () { cout << foo() << endl; print(bar()); return 0; }[/CODE] Can I …

Member Avatar for kevintse
0
125
Member Avatar for kevintse

Hi, all I have been learning the python language for a couple of weeks. For now I only know a little of the language, the syntax, usage of the builtin types such as str, lists, dicts, and tuples, this is fine for writing some simple scripts to process text files. …

Member Avatar for kevintse
0
147
Member Avatar for badenpearce

Hi, I'm an experienced developer but not done much in c++ and wanted to get some basic database operations in my program, open, store, retrieve etc. Does anyone have any good links that could get me started? Thanks Baden

Member Avatar for Stefano Mtangoo
0
358
Member Avatar for kevintse

Hi, everyone. I am stuck when trying to solve such a problem, I need your help. We have a website for online e-book reading that holds around 60,000 books and currently has 5 million registered users, we are using MySQL for storage of all the data. Now there's requirement from …

Member Avatar for jwenting
0
204
Member Avatar for kevintse

Hello, everyone. I have a question to ask. According to The C++ Programming Language (3rd. Ed.) by Bjarne Stroustrup on page 405: "Members declared [COLOR="Red"][B]protected[/B][/COLOR]are far more open to abuse than members declared [COLOR="red"][B]private[/B][/COLOR] . In particular, declaring data members protected is usually a design error. Placing significant amounts of …

Member Avatar for kevintse
0
1K
Member Avatar for kevintse

Hi, everyone. I am stuck in such a situation: When failing to open a file, of which the name is in Unicode, I need to show the user something like "Can't open file: \My Document\file-name-in-unicode.txt" by throwing an exception . I often use exceptions this way(is this a good way?). …

Member Avatar for kevintse
0
3K
Member Avatar for CppBuilder2006

is there any GDI or GDI+ function or method that copies part of client area? something like this: [CODE] char p[100000]; copy(hdc, p, rectangle(10,10,100,100)); paste(hdc, p, x, y); [/CODE]

Member Avatar for kevintse
0
122
Member Avatar for kevintse

I am building applications targeting Windows Mobile, I need to read and write files. I am not sure whether to use the C++ standard library (iostreams) or the Windows API (ReadFile(), WriteFile()...). I think the Windows API is faster than the C++ standard library, but they are not object oriented, …

Member Avatar for Frederick2
0
216
Member Avatar for kevintse

As I emphasize *piece by piece* in the question, I have to read the ANSI file piece by piece to conserve resources, say 40 kilobytes for each read. Now I am handling an ANSI file that contains Chinese characters (encoded using the GBK charset, two bytes for each Chinese character …

Member Avatar for Ancient Dragon
0
134
Member Avatar for kevintse

Well I am writing a program for Windows Mobile phone, I need to read text files in the program, the character sets (charset) of the files I am going to read are unknown, here I need to convert whatever text(Actually I probably only need to handle UTF-8, UTF-16 BE, GBK, …

Member Avatar for kevintse
0
304
Member Avatar for kevintse

Sorry but I don't know whether this is the right place to ask this. I want to create a scroll bar that can scroll the content in the main window. The difficulty is that I don't know how to calculate the accurate length of the whole content (blending of English …

Member Avatar for nucleon
0
102
Member Avatar for kevintse

Well, I know there are so many IM services. and that I want to build an IM system is just for practicing my programming skill. Here there are several questions that come up to my head when starting to design it. As far as I know, we can only receive …

Member Avatar for PoovenM
0
140
Member Avatar for kevintse

[code=c++] #include <iostream> using namespace std; #define OUT(x) cout << (x) << endl; template<class T, int size> class Stack{ T arr[size]; int top; public: Stack():top(-1){} void push(T obj); T pop(); }; template<class T, int size> void Stack<T,size>::push(T obj){ top++; if(top >= size){ top--; OUT("the stack is full"); }else{ arr[top] = …

Member Avatar for kevintse
0
130
Member Avatar for kevintse

hi, everyone, i am new to C++, i tried implementing a String. and i need your help, i want to know what to improve for this class regarding performance, or everything else you think i should pay more attention to when implementing such a class for general use(of course, i …

Member Avatar for ArkM
0
126
Member Avatar for kevintse

[code=cplusplus]#include <iostream> using namespace std; #define PRINT(x) cout << #x " = " << x << endl; class Object{ public: Object():i(5){} int i;; }; int main() { Object o; o.i = 5; int* p = &(o.i); PRINT(*p); int Object::* p2m = &Object::i; PRINT(o.*p2m); return 0; }[/code] the two PRINT macros …

Member Avatar for ArkM
0
124
Member Avatar for kevintse

int& fun(){ int a = 10; cout << &a << endl; return a; } int main() { int& r = fun(); cout << r << endl; cout << &r << endl; return 0; } outputs of the code above are: 0xbf8567b4 10 0xbf8567b4 and when i change `int& r = …

Member Avatar for kevintse
0
67