RTTI basics


Hi all. I would like to use a class hierarchy where one const data field holds a class-specific value. I would like to do something like class base{public; static const int n}; class a : public base{public:}; class b : ...
Posted On: Monday 26th of November 2012 12:47:53 AM Total Views:  311
View Complete with Replies

RELATED TOPICS OF C Language PROGRAMMING LANGUAGE




Having problems with the basics.

, I am new in programming and started with C. but i am having some problems with the basics since i am studing on my own with no teacher thus online support is the only key. Following are the doubts i am having:- 1) For the code below there was not output,the screen flashed and i was back on coding screen Code: #include #include main() { return(printf("AMAZING!!")); } but without running it again i immediately changed it to Code: #include #include main() { printf("AMAZING!!"); } i got the result as AMAZING!! AMAZING!! Please help me understand this, Originally Posted by deepak_007 I dont wanna sound rude here but i was hoping for a reason for this output Like whiteflags said, you should follow the rules and best practices first. A couple to get you started: 1) Don't use conio.h it's non-standard 2) main should be declared with an int return 3) Don't return the rcode from printf, absolutely no need to do that. 4) Return 0 from main (or 1 if there was an error) Other than that, try opening up a console window and running your program from there. I'm sure it will only print once, maybe the output from your first run was buffered and thus it was shown on the screen when you ran the program a second time., Sorry for the delay, my internet connection was showing problems. Thank you all for your valueble answers but i would also request you to suggest a nice IDE for C language. Thanking you again.
VIEWS ON THIS POST

180

Posted on:

Monday 8th October 2012
View Replies!

Random number basics

. I am trying to generate random numbers with the code below, but every time I run it, I get the number 41. What am I doing wrong
VIEWS ON THIS POST

417

Posted on:

Thursday 18th October 2012
View Replies!

c ++ basics

http://computer-programmings.blogspot.com
VIEWS ON THIS POST

156

Posted on:

Sunday 4th November 2012
View Replies!

Announcing Xrtti - Extended Runtime Type Information for C++

Xrtti is a tool and accompanying C++ library which extends the standard runtime type system of C++ to provide a much richer set of reflection information about classes and methods to manipulate these classes and their members. It is intended to provide a much more complete set of reflection capabilities to C++ than the standard C++ rtti feature. I have released the first public version of this tool, version 0.1, under the GNU GPLv2, and would welcome feedback on it. Xrtti is at: http://www.ischo.com/xrtti Thank you, and best wishes, Bryan -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] , On May 1, 5:50 pm, Mathias Gaunard wrote: > Wouldn't compile-time reflection be more than enough > Is there really a need for that kind of reflection at runtime I am sure that some creative people can think of useful things to do with this kind of enhanced runtime reflection. I have thought of a few: - Write a tool that allows one to "script" C++; if you linked this tool into your program, it would use the reflection information presented by Xrtti to let you via a command line interface, create objects, call methods on them, change values, etc. Not sure exactly what kind of program could take full advantage of this kind of capability but it is interesting. - Some kind of automated testing support If you can call any method on any class via reflection, you could write a library that supported some kind of automated testing by walking the tree of classes in your program and instantiating objects, calling methods on them, etc. - You can serialize and deserialize instances of any class you define, via a single library that uses the extended runtime type information to walk over the data members of your classes. In fact, the last one is the reason that I wrote Xrtti; I had written a tool that adds serialization support to all of your classes "for free", without any changes necessary to your class definitions (unlike other C++ serialization systems that I have seen, such as Boost::Serialization and s11n, which just provide frameworks to assist you in serializing your objects, but you still have to write the serialization code). I then realized that this could be done more cleanly in two parts: 1) a tool that generates extended runtime type information, and 2) a serializer library that operates on this information. I assumed that since I found something useful to do with (1), others may think of other interesting things to do with it as well.
VIEWS ON THIS POST

112

Posted on:

Wednesday 7th November 2012
View Replies!

rtti in msvc

I want to use RTTI in a current project, but some people have warned me that RTTI incurs a major performance penalty in MSVC. I've seen some posts on the net saying this is so, but no one who has been able to substantiate it, and it kind of sounds like an urban legend to me. Does anyone actually know the facts on this case -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]
VIEWS ON THIS POST

110

Posted on:

Wednesday 7th November 2012
View Replies!