Sign in to follow this  
HDRebel88

C++ Tutorials

Recommended Posts

If i were you i'd recommend getting started with making DOS programs.

And then when you are ready you can get Microsoft Visual C++. Because C++ is such a huge language you will need to learn the absiloute first.

Heres a link to get you started : http://www.cplusplus.com/doc/tutorial/
And heres Visual C++ : http://www.microsoft.com/express/vc/

Share this post


Link to post
Share on other sites

New question... can I create a program that uses 64-bit processors with Visual C? The Visual C link says "Create native Win32 applications". Plus I need to program for MAC and linux. And I need to optimize for multi-thread and -core processors.

Share this post


Link to post
Share on other sites

Don't have a clue.

Although though, C++ is run by headers, streams and namespaces from the computer, Visual C automatically creates these links but you can add or remove them manually

like in a DOS program the basic stream you need is "iostream"

to make a simple Hello world would be

#include <iostream>

using namespace std;


int main ()

{

  cout << "Hello World!";

  return 0;

}



Im not sure what you need to do for a linux application but this is what Namespaces, Headers and Include streams are

#include <iostream>
Lines beginning with a hash sign (#) are directives for the preprocessor. They are not regular code lines with expressions but indications for the compiler's preprocessor. In this case the directive #include <iostream> tells the preprocessor to include the iostream standard file. This specific file (iostream) includes the declarations of the basic standard input-output library in C++, and it is included because its functionality is going to be used later in the program.

using namespace std;
All the elements of the standard C++ library are declared within what is called a namespace, the namespace with the name std. So in order to access its functionality we declare with this expression that we will be using these entities. This line is very frequent in C++ programs that use the standard library, and in fact it will be included in most of the source codes included in these tutorials.

- As from http://www.cplusplus.com/doc/tutorial/program_structure.html

Share this post


Link to post
Share on other sites

If you are going to code for linux, mac and windows, you would probably want to use a cross-platform interface such as GTK+, Qt, wxWidgets, etc.

Share this post


Link to post
Share on other sites

With this stuff being free-ware does limit my abilities to sell my software if I use this stuff?

Okay I downloaded both Visual C and wxWidgets. How do I acutally install wxWidgets all I get is a bunch of Test files.

Share this post


Link to post
Share on other sites
With this stuff being free-ware does limit my abilities to sell my software if I use this stuff?


No, ofcorse not lol - you can however be kind to the creator of the compiler and place a little backlink.

Borland is a great compiler, very powerful - but then again, its for dos.

Heres a tutorial for wxWidgets http://zetcode.com/tutorials/wxwidgetstutorial/

yes tutorials rule our lives...

Share this post


Link to post
Share on other sites
I always think it is right to donate a bit of money to the creator of freeware if you are going to use it to make money.


Well I would actually pay for it, but I don't have any money to spend right now. I'd have to wait to sell my first unit before I could really donate anything.

Share this post


Link to post
Share on other sites

Okay this wxWidget thing is making no sense to me. Is it supposed to be a seperate program or what? All I see are .h files... No install.exe, no setup.exe, nothing...

Share this post


Link to post
Share on other sites
I think you got the source code, you should compile it first.


Open Visual C --> Build ---> Batch Build; right?

Tried that and it went through everything, and then nothing happened.

Share this post


Link to post
Share on other sites

Does anybody know a good tutorial that could help me create a password generating type program in C++
Something that randomly generates letters, numbers, and symbols combined

Share this post


Link to post
Share on other sites

Okay, I found a C++ for Dummies book that my grandfather has... it references GNU C++. Would there be any differences between what the book has in the programs they show and what I would need to type if I use Visual C++ instead of GNU C++?

Things like the #include <iostream.h> or #include <stdio.h>
Don't know if those included files are specific to which program I use or not.

Or should it all be the same?


EDIT: I wrote my first program, but I have no idea how to complile it in Visual C++. My only menu options are File, Edit, View, Project, Debug, Tools, Window, and Help. No Build or Compile options.

Share this post


Link to post
Share on other sites

You need to create a project via vc++. Because you have no solution.

Copy everything you have, go to file -> create project -> and go to empty project (if you can find something of the sort)

And delete everything, then paste in your code.

Because vc++ needs a solution to base upon the compilation

Share this post


Link to post
Share on other sites

Okay, did that and now I get:

1>------ Build started: Project: convert, Configuration: Debug Win32 ------
1>Embedding manifest...
1>mt.exe : general error c10100b1: Failed to load file "..\Debug\convert.exe". The system cannot find the path specified.
1>Build log was saved at "file://c:\Documents and Settings\Movie\My Documents\Visual Studio 2008\Projects\convert\convert\Debug\BuildLog.htm"
1>convert - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========




// Program to convert temperature from Celsius degree units into Fahrenheit degree units

// Fahrenheit = Celsius * (212 - 32)/100 + 32

//

#include <stdio.h>

#include <iostream.h>


int main(int nNumberofArgs. char* pszArgs[])

{

	//enter the temperature in Celsius

	int celsius;

	cout << "Enter the temperature in Celsius:";

	cin >>celsius;


	//calcuate conversion factor for Celsius to Fahrenheit

	int factor;

	factor = 212 - 32;


	//use conversion factor to convert Celsius into Fahrenheit values

	int fahrenheit;

	fahrenheit = factor * celsius/100 + 32;


	//output the result

	cout << "Fahrenheit value is:";

	cout << fahrenheit;


	return 0;

}

Share this post


Link to post
Share on other sites

Hmm, i dont think its anything wrong with the code?

It says

1>mt.exe : general error c10100b1: Failed to load file "..\Debug\convert.exe". The system cannot find the path specified.



Which is probs the source of it, what about the build log? And go into the "debug" directory and see if anything is in there?

Share this post


Link to post
Share on other sites

Build Log:

Build Log Build started: Project: convert, Configuration: Debug|Win32

Command Lines
Creating temporary file "c:\Documents and Settings\Movie\My Documents\Visual Studio 2008\Projects\convert\convert\Debug\RSP00000460964628.rsp" with contents
[
/outputresource:"..\Debug\convert.exe;#1" /manifest

".\Debug\convert.exe.intermediate.manifest"
]
Creating command line "mt.exe @"c:\Documents and Settings\Movie\My Documents\Visual Studio 2008\Projects\convert\convert\Debug\RSP00000460964628.rsp" /nologo"

Output Window
Embedding manifest...
mt.exe : general error c10100b1: Failed to load file "..\Debug\convert.exe". The system cannot find the path specified.

Results
Build log was saved at "file://c:\Documents and Settings\Movie\My Documents\Visual Studio 2008\Projects\convert\convert\Debug\BuildLog.htm"
convert - 1 error(s), 0 warning(s)


And there's nothing in the Debug folder just the BuildLog itself/

Share this post


Link to post
Share on other sites

odd o.o, it seems like its having difficulties saving the compilation. just to clarify, you have saved your solution using the "save all" rather than just save? ive been working with C# for a while now and i have never experienced that

Share this post


Link to post
Share on other sites
odd o.o, it seems like its having difficulties saving the compilation. just to clarify, you have saved your solution using the "save all" rather than just save?


Yep...used "Save all".

Share this post


Link to post
Share on other sites

what program do you think i should use to write...im currently using dev-c++
do you know any really good easy tutorials by any chance?

Share this post


Link to post
Share on other sites
With this stuff being free-ware does limit my abilities to sell my software if I use this stuff?


If you are using wxWidgets then I would recommend you licence it under the GNU GPL 3. The licencing of wxWidgets is identical to the LGPL except that it allows distribution on the users own terms. I am deeply opposed to this licence as it does not preserve the original intentions of the GNU GPL. But you can distribute the software under whatever licence you wish. However, under the GNU GPL you can offer the software binaries (at a charge) while still ensuring the project is free (as in beer) and users can modify it to their needs etc.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this