Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
25% Quality Score
Upvotes Received
2
Posts with Upvotes
2
Upvoting Members
2
Downvotes Received
9
Posts with Downvotes
9
Downvoting Members
3
0 Endorsements
~3K People Reached
Favorite Tags
Member Avatar for atch

Guys I've read http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx?PageIndex=4 great discussion and quite to the point frank critisizm of herb sutter. Does anyone know what his formal education is? I tried to google it out but draw blank from it.

Member Avatar for atch
0
232
Member Avatar for atch

Is it possible to have pointers to references in c++? I'm asking because in my simple code: [code=c++] #include "stdafx.h" #include "Nunu.h" int _tmain(int argc, _TCHAR* argv[]) { Nunu* p = new Nunu[5]; Nunu a("a"); Nunu b("b"); Nunu c("c"); p[0] = a; //critical line/s p[1] = b; // p[2] = …

Member Avatar for atch
-1
284
Member Avatar for atch

Hi, I'm trying to initialize string with iterators and something like this works: [code=c++] ifstream fin("tmp.txt"); istream_iterator<char> in_i(fin), eos; //here eos is 1 over the end string s(in_i, eos); [/code] but this doesn't: [code=c++] ifstream fin("tmp.txt"); istream_iterator<char> in_i(fin), eos(fin);/* here eos is at this same position as in_i*/ //moving eos …

0
43
Member Avatar for atch

Hi, Is it possible to have class template in non template class? I'm trying something like this and I'm getting errors: [code=c++] class Non_Template { //...other stuff public: template<class T> class some_Template; //declaration }; template<class T> //something WRONG with this syntax Non_Template::some_Template { }; [/code] Err msg I'm getting: error …

Member Avatar for atch
1
108
Member Avatar for atch

Hi everyone, I'm trying to compare list iterators: [code=c++] list<int> l; list<int>::iterator lb = l.begin(); list<int>::iterator le = l.end(); if (lb < le) //here I'm getting error - no operator match these operands: { //do something } [/code] And when I change this that instead of list I have vector …

Member Avatar for atch
0
109
Member Avatar for atch

Hi, I'm trying to implement my own allocator using malloc and free. One thing what interests me is that in declaration of deallocate in addition to pointer we have also parameter size which suppose to be size of elements allocated with allocate but having implemented my deallocate as this: [code=c++] …

Member Avatar for atch
0
90
Member Avatar for atch

Hi, I've got construction of namespaces like this: namespace one { namespace two { class SomeClass{...}; } } and when I try to use this class (without fully qualified name) in another file (also with nested namespaces) I'm getting errors. It doesn't even help if I place declaration of using …

Member Avatar for atch
0
83
Member Avatar for atch

Hi, I just wrote a simple (but how enjoyable;) game and I also have help file for this game in txt format. I wonder how can I compile this file into my *.exe file that I would do not need to have two files (one *.exe and second *.txt) only …

0
33
Member Avatar for atch

Hi, guys. Just installed new borland c++ 2010 - I think it's quite cool. One question though, where can I find comment and uncomment command? Thank you

Member Avatar for atch
0
149
Member Avatar for atch

Hi, Just wonder if there is any way to get this information while compiling your source code, what I mean is if I can do something like this: [code=c++] //pseudo code if (IDE == BORLAND) cerr << "You are using: " << _COMPILER << endl; if (IDE == VISUAL_STUDIO) cerr …

Member Avatar for Tom Gunn
0
67
Member Avatar for atch

Looking through boost random library I've come across literal something like 331u. Does anyone can explain to me what this u is about? [code=c++] void seed(uint32_t value = 331u); [/code] Thank you

Member Avatar for Dave Sinkula
0
154
Member Avatar for atch

Hi, I tried to be clever and wrote template (body below), and something is not working as I would like it to. I have to explicitly cast template parameter on desired type instead of function recognize type (by id() method provided in class object); I don't understand why is it. …

0
43
Member Avatar for atch

Hi, I know that this topic was discussed previously but those previous threads didn't answer to my question which is: How to change color of this text: [code=c++] cout << "Some text" << endl; [/code] when I'm outside of main, i.e. in file with my class and in one of …

Member Avatar for atch
0
260
Member Avatar for atch

Hi, I would like to ask a question and I'm quite certain that I'll get positive answer to that. When I've change some code in one file and press f5 (visual studio) it seems to me that all other files are being compiled as well as this one in which …

Member Avatar for atch
0
75
Member Avatar for atch

Hi, I'm trying to fork out number from this expression. Obviously without any luck. I wonder if anyone could help and suggest good book about regex. [code=c++] boost::regex reg("[[:blank:]]*move[[:blank:]]*\\d{1,3}[[:blank:]]*, boost::regbase::icase); [/code] Thank you

Member Avatar for atch
0
101
Member Avatar for atch

Hi, I've just came across declaration of this form: [code=c++] void fun() throw(); [/code] Could anyone explain what is the pourpose of this and maybe someone knows good book with thorough explanaition on this subject. Thank you

Member Avatar for atch
0
116
Member Avatar for atch

Hi, I've got problem with method ignore from cin. This is my code: [code=cplusplus] void _name() { string name; char ch = 0; bool name_accepted = false; cout << "Enter your name: " << endl; while (!name_accepted) { while (ch = cin.get()) { //cin. if (isalnum(ch) || isspace(ch) || ispunct(ch)) …

Member Avatar for atch
0
178
Member Avatar for atch

Hi, Could anyone explain to me why this works: [code = c++] #include "stdafx.h" #include <iostream> using namespace std; class A { public: A() { a = 0; } int a; }; void change(A* source, A* destination) { destination = source; } int _tmain(int argc, _TCHAR* argv[]) { A* ob1 …

Member Avatar for kvprajapati
0
125
Member Avatar for atch

Hi, Just wonder is there any way to display enum as enum not as integer? Thank you.

Member Avatar for wildgoose
0
92
Member Avatar for atch

Hi, in my code below if I move scope protected below public just as I would like to see it this code won't compile. I always thought that order of members in class is without any importance but here I see something different or I'm doing something wrong? Thank you. …

Member Avatar for jesseb07
0
101
Member Avatar for atch

Hi, I've got structure like this class Object //abstract { virtual....=0; }; class Monster : public Object {}; //also abstract class Wumpus : public Monster {}; class Hero : public Monster {}; class Gun : public Object{}; class Cave : public Object { void add(Cave*); void add(Monster*); }; the second …

Member Avatar for atch
0
120
Member Avatar for atch

Hi, I've tried to output pointer in decimal but can't do it [code] int a = 10; int* p = &a; cout.unsetf(ios_base::hex); cout.unsetf(ios_base::oct); cout.unsetf(ios_base::dec); cout << showbase << dec << p << endl; [/code] it still shows this output in hexadecimal format. Any reason why this doesn't work. Thanks in …

Member Avatar for atch
0
78
Member Avatar for atch

Hi, I've written some fnc and when I tested it it works perfectly but when I switch from debug mode to release mode I'm getting error: Intrisinc function, cannot be defined. Any idea what's wrong? [CODE] typedef unsigned int u_int; int strcmp(const char* s, const char* s1) { u_int size_s …

Member Avatar for atch
0
109
Member Avatar for atch

Hi, I just wonder if this is possible: (semi-pseudocode (won't work as planned)) ofstream fout("my_file.txt"); fout << cout; Looking forward to your reply

Member Avatar for Narue
0
117
Member Avatar for atch

Hi, it's me again, Another two problems which I'm having with this example is that when in ofstream constructor I specify mode as binary: ofstream fout("my_file.txt", ios_base::binary); nothing is written to a file (at least I can't see there anything) and another problem which I cannot cross is that I …

Member Avatar for atch
0
70
Member Avatar for atch

Hi, I'm trying to print to a file some data of objects and I'm trying to do this in pseudo xml format so my file would look like let's say: <node> data </node> I'm using write method: [code = C++] fstream fout("my_file.txt"); fout.write("<name>", sizeof(7)); fout.write("\n", sizeof(2)); fout.write(this->name(), sizeof(this->name()).length()); fout.write("\n", sizeof(2)); …

Member Avatar for atch
0
79
Member Avatar for atch

Hi, I'm quite new to C++ and I'm trying to write a function which would change uppercase letter in char[] to lowercase. Inside this function everything is fine but when I leave it, contents of char[] is not changed. Any ideas why? Also when I try to delete local pointers …

Member Avatar for atch
0
128