![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |
| |||
| Regarding Windows programming, I recommend theForger's Win32 API Tutorial unless you wish to use MFC (Visual C++ only as far as I know). Of course, there are also Windows Forms now with the .NET platform, so that may also be an option. Personally, the Win32 API made me wonder why it is so complex. There is an event handler for EVERYTHING. A simple text editor can be difficult for a Win32 API beginner using just the Win32 API. As for MFC and Windows Forms, I have no experience with either of them, though I plan to look into MFC possibly. |
| The Following User Says Thank You to rpgfan3233 For This Useful Post: | ||
Lee (07-14-2007) | ||
| ||||
| Quote:
I was hoping you could maybe make a list for me and other beginners looking, things i can think of to start: 1. Hello World Program 2. Variables 3. Using input & variables e.g. cin 4. Simple mathmatical operators. 5...?? Maybe you could continue it a little bit, it would help me greatly ![]() |
| ||||
| Well, I personally say that I don't really care with the really basic ones, since you can also find it everywhere lol... I personally want to see conscepts (rules in C / C++) and little more advanced such as: Multidimentional Arrays, Arrays, Recursive Methods, ..... ![]() BTW, does C++ has the same types of variable that can store the same size in memory as Java? (I'm not positive at this since Java is much higher level language than C++) |
| ||||
| Quote:
I cant really help with your question as i am not familiar with Java, YET ... On my list of things to learn in the next 5 years lol. |
| |||
| Quote:
Quote:
variable types compared: C++ v.s. Java Quick note: Java only has signed data types bool[1] = boolean - 1-byte (8-bit) type that utilizes true/false values char = byte - 1-byte (8-bit) type that allows you to use characters/values 0-255 (-128 to 127 when using signed values) short[2] (int) = short - 2-byte (16-bit) integer type that allows you to use integer values in the range 0x8000-0x7FFF (-32768 to 32767 (signed), 0 to 65535 (unsigned)) long[2] (int) = int - 4-byte (32-bit) integer type that allows you to use integer values in the range 0x80000000-0x7FFFFFFF (-2,147,483,648 to 2,147,483,647 (signed), 0 to 4,294,967,295 (unsigned)) long long[3] (int) = long - 8-byte (64-bit) integer type that allows you to use integer values in the range 0x8000000000000000-0x7FFFFFFFFFFFFFF (-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (signed), 0 to 18,446,744,073,709,551,615 (unsigned)) [1] - bool in C++ is technically just an integer type that allows you to use keywords "true" and "false". In Java when you output a boolean value, the result is either True or False. In C++, the respective output is 1 (True) or 0 (False). Also, the Java boolean data type isn't precisely defined as 1 byte in size. It only takes up 1 bit (0 or 1), but the least amount of bits you can operate on is 8 bits (1 byte). [2] - In C++, the value of the int type depends on whether it is equivalent to the short int type or the long int type. The way to test is by using std::cout << ((sizeof(int) == sizeof(long)) ? "true" : "false") << std::endl; [3] - long long (int) is not officially an ISO C++ data type. However, it is most probably going to be present in C++0x when the standard is published. It is present in many compilers to remain compatible with C99, which adds signed long long and unsigned long long to its list of primitive data types (char, short, int, long, etc.) ---- The closest equivalent of the Java char data type (a 16-bit Unicode character) in C++ is known as wchar_t (wide-character type), which is declared in wchar.h (it is not a primitive data type). It may behave the same, but I'm not sure if it does or not since I have little experience with wchar_t. Edit 1: Quote:
As for the APIs used in Windows, you can use the Win32 API, which uses an event-driven model. This is as close to Windows as you can get. You can use MFC, which is a form of the Win32 API for C++ programming (much cleaner using MFC than normal Win32 programming). There is also the .NET framework, which allows you to use Windows Forms. It is simply another way to code the same thing, except this one is purely for .NET rather than for C or C++ or whatever. C# uses it, just like VB.NET, VC++.NET and J# use it because they are all a part of the .NET family. Edit 2: As for a specific API for C++, there are some that exist, such as wxWidgets, but any API that can be used with C can almost certainly be used with C++. However, APIs for only C++ cannot be used with C because C is almost 100% compatible with C++, but C++ is less than 20% compatible (I'm guessing) with C because of the features that C++ uses, not to mention the extremely strong type checking in C++ whereas C is fairly relaxed. However, I don't think you can quite mix APIs for GUI programming in very many languages other than Java (you can mix AWT and Swing somewhat). Last edited by rpgfan3233 : 07-14-2007 at 09:13 PM. Reason: Answered another question and hopefully clarified some things. |
| The Following User Says Thank You to rpgfan3233 For This Useful Post: | ||
HelloWorld (07-14-2007) | ||
| ||||
| Quote:
Code: int wrong = false Edit: Please give me some example C++ variable writing and the way you reference them? |
| |||
| Quote:
Code: typedef enum { false = 0, true = !false } bool; Quote:
Code: int x = 2; //valid code in C, C++, Java and C#
// uncomment the one that you want
// std::cout << x << std::endl; //C++ - remember to include <iostream>
// System.out.println(x); //Java
// System.Console.WriteLine(x); //valid C# I think
// printf("%d\n", x); //C - remember to include <stdio.h> Edit: Visual C++ 6.0 gave me a warning when I tried to assign 2 to "bool right". It truncated the value from a "const int" ("final int" in Java, I think?) to a non-zero value (1), which is considered true. However, that was only a WARNING, not an ERROR. In other words, any non-zero value is true. However, for integer types and character types other than bool, one shouldn't get into the habit of something like: Code: while (!feof(myfile)) { //while the file pointer hasn't reached the end of the file, execute code
//code
} Code: while (feof(myfile) != 0) { //while the file pointer hasn't reached the end of the file, execute code
// code
} Code: x = (n <= 0); //if n is less than or equal to 0, then x = 1, otherwise x = 0 Last edited by rpgfan3233 : 07-14-2007 at 11:13 PM. Reason: Added some information... |
| The Following User Says Thank You to rpgfan3233 For This Useful Post: | ||
HelloWorld (07-21-2007) | ||
![]() |
| Thread Tools | |
| Display Modes | |
| |