|
a) please post code in <pre> tags, and use the "Do not treat <'s as HTML tags" checkbox (or use < and > for < / > )
b) Assignment operator and copy constructor take an argument of type T const &
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
Sorry about that. This is what it should look like.
template <class T>
class VSet : public std::vector<T>{
public:
void add(T pT);
};
template <class T>
void VSet<T>::add(T pT){
iterator i = begin();
while (i != end()){
if((*i)==pT){++(*i);return;}
++i;
}
push_back(pT);
}
|
|
|
|
|
Hi all... I want to know how to start with c++.. from the a to the z
I mean not only the dos commands, but also the MFC.. so simply how to get start from 0 until to be a prof.
thanks : )
|
|
|
|
|
you gonna have to start with a GOOD LUCK !
depends on what you know right now ? you know nada in c langage ?
what other langage you know ?
and why you want to know it ? what kind of prof you wanna be, etc....
c is in some way a hard langage, you better start with C than c++, and learn a little bit with a little bit.
Do you have knowledge in Object Oriented coding ?
|
|
|
|
|
I suggest you either enroll in a programming class, or go to a bookstore and buy beginners level books.
You can find books with CD included that will make life easier at the beginning.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
OKI DOKI..
I know the website design language.. such like java script and html and php and so on... I don't have any background with c... and I have been told that there is no need to study it.. but I have studied the basic codes of c++ that i run it under dos... like cout and cin and + / * and so on... so my uqestion is when i finish this start level... what should I do after that?
|
|
|
|
|
Programming languages (like C, C++, Java and C#) are merely tools, and therefore a means to an end. The right approach (imho) is to take a few basic CS courses (data structures, algorithm design, object oriented programming, Windows (i.e. event driven) programming, to name a few) and learn C/C++ along the way.
Think of it as the difference between the tools (the languages) and knowing how to use them. It's easy enough to learn how to use a saw, chisel, hammer and screwdriver, but that's not enough to become a master carpenter. You have to know the ins and outs of woodworking (in other words CS) to achieve that goal.
You seem to have the enthusiasm required to embark on this venture. Good luck! It can be insanely rewarding!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Practice.
I assure you that in C++ you have choosen the most extensible programming language present.
My advice is to master C++. I said master C++.
Kuphryn
|
|
|
|
|
You should consider C++ less of a "tool for writing programs", but more a "tool to make tools for writing programs": there is a lot more to learn besides the language itself.
The following is a roadmap to "Mastering C++" - hiw I would teach it. Some people might want to reorder the list which is fine with me - it all depends on the teacher and the tools.
Chapter (I) Learning the language, and how to not abuse it
a) Learn the basics language: type system, control structures, functions, scope.
b) learn concepts and tools: programming style, structuring your program using functions, the difference between contract, declaration and implementation
c) learn the language: pointers. pointer arithmetic, referencing, dereferencing, pointers vs. references, pointer to pointer, adress of pointer, allocating raw memory, etc.
c2) If you didn't succeed with (c): learn pointers
c3) if you don't get it the third time, give up. Really. I am serious.*
d) Learn debugging. This means assert, trace, using a debugger, distrusting yourself, acquiring some programming style.
e) learn the language: classes. Member functions, constructor, destructor
f) learn concepts: encapsulation, simple object design, encapsulating state
g) learn exceptions **
h) repeat concepts: good programming style, contract vs. declaration vs. implementation
i) learn concepts: inheritance, polymorphy
j) learn concepts: "enhanced" object design with the new knowledge (exceptions and polymorphy)
k) Learn some refined points of the language: const-correctness, default constructor, copy constructor vs. assignment operator, how to make a class behave like a built in type (but skip operator overloading)
l) learn the language: function templates, class templates
m) get an introduction on the STL (standard template library, which makes the biggest part of the C++ run time library)
n) ok, now, just as sugar, operator overloading, and how to make types truly act like built-ins
YES, now you are allowed to leave the console.
Chapter (II) ...but also MFC
a) refine your knowledge on the STL
b) learn some Windows API basics: Windows, Event Driven Programming, Window Handles (you can omit *creating* windows here, since this is a painful task made much easier by frameworks - but the rest is important to understand and makes working with the MFC easier). Windows Messages, GDI, standard controls etc.
c) Do the MFC "Scribble" tutorial, just following the main path (up to "printing" or so). Don't try to udnerstand everything, just get a feeling for the "flow".
d) Do the "Scribble" tutorial again, this time exploring the background explanations etc.
Chapter (II) Become a Pro
a) Notice that, once you are here, you are the löast person on earth doing MFC
b) Learn enhanced concepts: Exception Safety, Patterns etc.
c) Learn "Industry Power" stuff: Automated Tests, Version Control, Finalizing, and everything that belongs to running a larger project.
Warning: this course is a pain. In the ass, in the back, in your fingers, everywhere. Yet, it's IMO one of the shorter routes to a pro. To be true, you could start with th MFC stuff pretty much after (I)-(j), but this makes you only half-a-programmer, and you might acquire some misfeats that are hard to get rid of later.
The order of the list itself clearly shows some drawbacks of the C++ language, namely, the position of exceptions, and the STL, which requires a pretty advanced understanding to not be a complete mystery even to use.
*) I pretty much agree with the thought that understanding pointers needs a certain "wiring" of the brain. All other stuff in C++ can be learned by a decently intelligent person. Pointers are different, you either get them, or you don't. If you can't do pointers, C++ will be a pain all the time.
**) that's really late, to late. They are an important tool for error handling - and people should learn it as early as possible. However, it doesn't make much sense wihtout a good grasp on scope and code flow. I would do exceptions right after (b), but books/courses don't do it without classes.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
i remember reading somewhere that it cant, but why not?
|
|
|
|
|
yes you can,
you have to precise it during the creation of your dll project. Moreover you have to choose between linking your dll dinamically or statically to the mfc.
|
|
|
|
|
I'm trying to create a program exposing it's interface to any third party software. No language limitations or assumption on the third party software can be made.The program is supposed to run as a service on a constant basis.
The program interface must reveal a way of reconfiguring/getting statistics from the program.
I'm wondering if anyone has an experience in the field of creating a program interface that will have following features:
1. Interprocess communication (Third party software will request/send information from/to my software)
2. Preferably will support remote usage. By a remote client.
One of the possible solutions is using a shared memory, but this is old and ugly approach.
Any suggestions with explanations,(COM?,COM+, DCOM?) will be highly appreciated.
|
|
|
|
|
SNMP?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Thank you for your response, but SNMP is just a means of interprocess communication, I need to expose the program interface somehow, thus SNMP is not enough.
|
|
|
|
|
sergeyv2002 wrote:
No [...] assumption on the third party software can be made
Does that mean the 3rd party software is available on in binary form, with no built-in support for the interface?
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
No. The third party software can be written on any language, but it must follow predifined basic rules, like calling the API exported by my program.
Sorry for the confusion.
|
|
|
|
|
Anyone know of a good ftp client class that works on ...... Linux.
Doing a project on Linux, and the only things I can see are FTP clients that are written in C, and not really very good either.
Just wondering if anyone knew of anything like the decent classes you get on Windows! Linux is pretty lame in this area.
|
|
|
|
|
|
|
Hello,
I have programming in VB, C# and have done a few applications in Visual C++ 6.
But how do all these programs compare against each other. I know that C# and VB.Net are about the same as they are run in the .Net framework, so they both depend on the .Net framework. But C# allows you to have better coding syntax as it is based on C++ and java.
I was told that Visual C++ unmanaged code was better than C#, VB.Net and managed Visual C++, only if it has been coded efficiently.
My question is what type of programs would you write with each of them? I was once told that Windows operating systems 2000, ME, and XP are written in unmanaged Visual C++.
If l am wrong with any of my comments, please correct me.
Many thanks in advance.
Steve
|
|
|
|
|
You're wanting to compare apples to oranges to grapes. Why? A screwdriver is comparable to a hammer is comparable to pliers in that they are all tools and all are made of metal. Other than that, they are designed for different applications.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I think he wanted to for what kind of project you gonna use one or the other.
In my case, I coded in vb6 and vb.net, I was using those when I wanted a little program to do something basic cause it was taking me less time. Or when I was coding software wich the rapidity isn't important and when I was using Database.
Now, I am coding in visual c++ 6.0 cause I am coding real time applications, so I can't really use others. My other choice would be visualbasic cause that's the only 2 way the api I have are coded with, and it would be too slow in those case.
I also use it, for small applications now, cause I am used to code in it, so to go with vb would take me a little more time now.
For c# I don't know, I never used it yet and didn't have the time to learn it.
|
|
|
|
|
How does one limit the app to a single instance without using mfc? I can only use regular c++.
Thanks,
sb
|
|
|
|
|
Use CreateMutex() as in this example. MFC is not required.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Really appreciate the link.
many thanks,
sb
|
|
|
|
|