- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
16 Posted Topics
[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 … | |
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. … | |
Re: Since you are an experienced developer, I thing you should have googled before posting an ask here. [url]http://tinyurl.com/2fzwdp7[/url] | |
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 … | |
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 … | |
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?). … | |
Re: You may need the BitBlt API, take a look at [URL="http://msdn.microsoft.com/en-us/library/aa930997.aspx"]this[/URL] | |
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, … | |
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 … | |
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, … | |
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 … | |
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 … | |
[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] = … | |
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 … | |
[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 … | |
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 = … |
The End.