C++ School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a C++ Expert!

Join 307,124 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,028 people online right now. Registration is fast and FREE... Join Now!




List of C++ Resources

5 Pages V < 1 2 3 4 5 >  

List of C++ Resources, All those free resources you need to get started

Rating  5
xAlanxEnglandx

RE: List Of C++ Resources

29 Jul, 2008 - 03:10 PM
Post #41

New D.I.C Head
*

Joined: 6 Jul, 2008
Posts: 31

to Polymath:

Well Ime starting to get used to OOP now thanks to born2code, thanks for the link... Its actually pretty simple if you use the right tutorial... well it will probably get more complex as I learn more about OOP

Ime kind of learning OOP from different tutorials at the moment also, some tell it easier than others aswell smile.gif

Much better than pointers though, i find them annoying. Polymath, as a programer your self, could you tell me how important pointers are and are they used alot in programs? becuase Ime not enjoying pointers there kind of confusing, might have to revise over pointers again sometime with a better tutorial than this book ime reading...





Thanks for the help smile.gif

This post has been edited by xAlanxEnglandx: 29 Jul, 2008 - 03:16 PM
User is offlineProfile CardPM
+Quote Post

Bench

RE: List Of C++ Resources

30 Jul, 2008 - 10:00 AM
Post #42

D.I.C Addict
Group Icon

Joined: 20 Aug, 2007
Posts: 907



Thanked: 76 times
Dream Kudos: 150
Expert In: C/C++

My Contributions
QUOTE(xAlanxEnglandx @ 30 Jul, 2008 - 12:10 AM) *
Much better than pointers though, i find them annoying. Polymath, as a programer your self, could you tell me how important pointers are and are they used alot in programs? becuase Ime not enjoying pointers there kind of confusing, might have to revise over pointers again sometime with a better tutorial than this book ime reading...

The importance of pointers depends on the programming language you're using, and what you're using it for.

In general low-level computing terms, pointers are the single dominant issue, since your Processor needs a method of indexing individual bytes in memory, and a pointer is merely an address, or an index, for the computer's memory (Or, perhaps more accurately, a representation of an address)

The reason for high level languages is to escape from this very primitive view of the system, and to allow common operations to be done simply without explicitly using pointers (Compilers do an excellent job of hiding all that), however there always comes a situation where some kind of pointer or index is needed.

Conceptually speaking, you could argue that a variable storing the position of a particular element within an array is like a pointer - Except that its a pointer which is very specific to that array. The variable is acting as a place-holder for something in the array.

in C and C++, the term 'pointer' is used to mean a place holder whose domain is your entire system memory; If it makes things easier, you could think of the memory like a very, very large array of bytes (of which your program will probably only use a small amount - the rest is usually locked out to your program by the OS)

For most programmers, where the issue of pointers start to become confused is partially related to the ugly syntax which C/C++ use to declare and access pointer variables, and also because programmers are ultimately not concerned with where data is stored in memory, they only care that the data is accessible to their program - yet the pointer adds a layer of indirection which needs to be handled carefully.

There's no easy or simple way to become comfortable with the concept of indirect access to data via pointers, except to just practice. Trial and error helps - particularly when it comes to de-mystifying or clarifying whatever assumptions about pointers you may have picked up along the way (Some of which will turn out to be false).

This post has been edited by Bench: 30 Jul, 2008 - 10:20 AM
User is offlineProfile CardPM
+Quote Post

xAlanxEnglandx

RE: List Of C++ Resources

30 Jul, 2008 - 03:25 PM
Post #43

New D.I.C Head
*

Joined: 6 Jul, 2008
Posts: 31

Bench:

Well ime learning C++, just revised pointers but is it true you have to assign the memory address to the pointer first before you can display it (in c++)?
User is offlineProfile CardPM
+Quote Post

polymath

RE: List Of C++ Resources

31 Jul, 2008 - 07:21 AM
Post #44

D.I.C Addict
Group Icon

Joined: 4 Apr, 2008
Posts: 650



Thanked: 21 times
Dream Kudos: 500
My Contributions
Pointers are confusing, took me over a month to get used to them. Pointers are used in most cases when you want to assign something based on user input. Yes, you could use a vector, but vectors tend to make a program quite large (in compiled size, not number of lines) and run slower than a pointer. In general, if i had a program that generated a given number of random numbers:

cpp

#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;

get_rand( int low, int high) {
int random;
random= lower + ( rand() % (high-low) );
return (random);
}

int main() {
int input_num;
int upper;
int lower;
int * rands;
cout << "How many rands do you want? ";
cin >> input_num;
rands=new int [input_num]; //if we created an array like ' int rands[input_num]; ' here, it would give an error
cout << "Bottom of range: ";
cin >> lower;
cout << "Top of range: ";
cin >> upper;
for (int i = 0; i < input_num; i++) {
rands[i]= get_rand (lower, upper);
}
for (int m=0; m < input_num; m++) {
cout << rands[m] << endl;
}
cout << "Press <ENTER> to exit. ";
cin.get();
delete[] rands;
return 0;
}


Another good way to use pointers is with a char array for user input, such as in C (which are great for ciphers and letter manipulation, 'cause that's hard to do with a basic string type). Basically, pointers can add a easy way to create an array that isn't of fixed legnth. You can do it with other containers, but i bet you $100 that vectors, basic strings, and other abstractions have a pointer in there somewhere! Rejoice, C is awesome because you can use pointers like in low level languages to add some speed and (believe it or not) simplicity, but you don't HAVE to like in higher level languages. The ONLY way to get used to pointers is to use them.
User is offlineProfile CardPM
+Quote Post

Bench

RE: List Of C++ Resources

31 Jul, 2008 - 09:33 AM
Post #45

D.I.C Addict
Group Icon

Joined: 20 Aug, 2007
Posts: 907



Thanked: 76 times
Dream Kudos: 150
Expert In: C/C++

My Contributions
QUOTE(xAlanxEnglandx @ 31 Jul, 2008 - 12:25 AM) *

Bench:

Well ime learning C++, just revised pointers but is it true you have to assign the memory address to the pointer first before you can display it (in c++)?

Yes, you need to have initialised the pointer first before you can do anything with it. There's no "default" value (it starts out undefined), so good common practise when declaring a pointer is to assign a null value to begin with to record the fact that it doesn't point anywhere.
eg, int* ptr = NULL; or int* ptr = 0; (Both do the same thing in C++)


User is offlineProfile CardPM
+Quote Post

Bench

RE: List Of C++ Resources

31 Jul, 2008 - 09:56 AM
Post #46

D.I.C Addict
Group Icon

Joined: 20 Aug, 2007
Posts: 907



Thanked: 76 times
Dream Kudos: 150
Expert In: C/C++

My Contributions
QUOTE(polymath @ 31 Jul, 2008 - 04:21 PM) *

Pointers are confusing, took me over a month to get used to them. Pointers are used in most cases when you want to assign something based on user input. Yes, you could use a vector, but vectors tend to make a program quite large (in compiled size, not number of lines) and run slower than a pointer. In general, if i had a program that generated a given number of random numbers:

Perhaps you could show some evidence to backup that claim about speed, since I would have to disagree - STL containers are highly optimised versus typical solutions involving dynamic arrays for common operations such as insertion and removal of elements. Most C++ programmers recognise that the STL is generally as efficient, or often more efficient than a homebuilt solution. (Provided that you pick the right container for the job of course)


I do agree that writing your own data structures are an excellent way to learn pointers, however, once you have, and feel comfortable with them, the best thing to do is to use the STL, except for the rare case where a homebuilt solution can be shown to have some significant benefits, because the STL is generally simpler to create and maintain, and has performance benefits on top.

QUOTE(polymath @ 31 Jul, 2008 - 04:21 PM) *

You can do it with other containers, but i bet you $100 that vectors, basic strings, and other abstractions have a pointer in there somewhere!
Of course they do! behind the scenes, there's generally alot of memory management going on (Typically, placement new is used to allow memory to be reserved or allocated in 'pages', rather than the naive implementations of constant reallocation which you would expect from a homebuild solution)

This post has been edited by Bench: 31 Jul, 2008 - 09:57 AM
User is offlineProfile CardPM
+Quote Post

gabehabe

RE: List Of C++ Resources

18 Aug, 2008 - 07:06 AM
Post #47

Sexy DIC
Group Icon

Joined: 6 Feb, 2008
Posts: 8,864



Thanked: 177 times
Dream Kudos: 3275
Expert In: Lots of things.

My Contributions
Thought I'd add this note here.

It's a common mistake, which I see in about 3 out of 5 threads in this forum.

Here's an example:
#include <iostream.h> .h ~ this is what I want to talk about.

For those of you who have studied C in the past, I'm sure you'll recall that when including a standard header file, you will add the .h suffix to the end of the library name. In C++ a lot of these have been deprecated, and there is a common fix to a large number of them.

This is the most common:
#include <iostream.h> should be #include <iostream>

Now, when including standard C libraries in a C++ program, you could use #include <stdio.h> However, a large number of names of C standard libraries have been altered for C++
Don't get me wrong, there's nothing wrong with using #include <stdio.h> but there's another way. In this method, we prefix the names of header files with c and remove the .h

Here are some of the common ones:
#include <stdio.h> -> #include <cstdio>
#include <stdlib.h> -> #include <cstdlib>
#include <time.h> -> #include <ctime>

Notice the pattern? This can't be said for all C libraries in C++ but it does apply to the majority. smile.gif
User is offlineProfile CardPM
+Quote Post

NickDMax

RE: List Of C++ Resources

18 Aug, 2008 - 08:28 AM
Post #48

Can grep dead trees!
Group Icon

Joined: 18 Feb, 2007
Posts: 5,267



Thanked: 293 times
Dream Kudos: 1175
Expert In: Java/C++

My Contributions
my 2 cents (gotta get in on this).

To add to Bench's comments -- STL *MAY* be slightly bloated in some instances but the STL container classes have been reviewed and re-reviewed by some some of the best programmers in the C/C++ industry. They are much more stable and reliable than the average homebrew. If you really think you can do a better job that these guys then fine write your own, but if you are at that point then you probably have been reading over and learning about techniques developed by these guys and I am sure they would love to have your input on the next version of the standard.

To add to Gabehabe's comments. The <iostream.h> style headers have been depreciated -- meaning that there is a better way to do things than using the <iostream.h> class. This does not mean that you can totally get away from .h headers, but for the standard C/C++ runtime environment you should use the new headers. But for NON-STANDARD headers like conio.h there is no cconio. You will also find yourself using things like <gl/gl.h> don't try <gl/cgl> or <cgl/gl>, or <sys/utime.h> does not become <sys/cutime>.

But ALL of headers that belong to the C++ Standard exclude the .h, and all of the C++ standard headers implementing the C standard headers are now prefixed with a 'c' to denote that they are part of the C library. Note that everything in these libraries are part of the std namespace. So, if you are not using the std namespace you need "std::printf" rather than just "printf" (note I am not sure if this is true an EVERY compiler -- it *should be* but some of the compilers support many of the standard C function natively and don't seem to care about the namespace).

This post has been edited by NickDMax: 18 Aug, 2008 - 08:33 AM
User is offlineProfile CardPM
+Quote Post

gabehabe

RE: List Of C++ Resources

18 Aug, 2008 - 08:32 AM
Post #49

Sexy DIC
Group Icon

Joined: 6 Feb, 2008
Posts: 8,864



Thanked: 177 times
Dream Kudos: 3275
Expert In: Lots of things.

My Contributions
I use the MinGW compiler, which came with Code::Blocks, and this compiles just fine:
cpp
#include <cstdio>

int main ()
{
printf ("This is a test");
return 0;
}

User is offlineProfile CardPM
+Quote Post

polymath

RE: List Of C++ Resources

19 Aug, 2008 - 07:59 AM
Post #50

D.I.C Addict
Group Icon

Joined: 4 Apr, 2008
Posts: 650



Thanked: 21 times
Dream Kudos: 500
My Contributions
I prefer to see c++ notation used in all C++ code wherever possible. I know that headers like windows.h and allegro.h are not cwindows and callegro, but for all cases where that is the case (like cstdlib, ctime, cstring, and cstdio, just to name a few) to use the c notation instead of the .h notation because the .h can be ambiguous whether you are using depreciated notation of C++ libraries or standard c notation libraries. Besides the fact that cstdlib just makes more sense than stdlib.h when you're using C++ (not to mention it sounds cooler). It is not the c++ stdlib, it is the C stdlib.
User is offlineProfile CardPM
+Quote Post

vikas1234

RE: List Of C++ Resources

21 Aug, 2008 - 11:02 AM
Post #51

New D.I.C Head
*

Joined: 21 Aug, 2008
Posts: 3



Try this site for a massive collection of FREE computer books ..


User is offlineProfile CardPM
+Quote Post

gabehabe

RE: List Of C++ Resources

21 Aug, 2008 - 11:03 AM
Post #52

Sexy DIC
Group Icon

Joined: 6 Feb, 2008
Posts: 8,864



Thanked: 177 times
Dream Kudos: 3275
Expert In: Lots of things.

My Contributions
Thanks! Added to the list!
User is offlineProfile CardPM
+Quote Post

myasia08

RE: List Of C++ Resources

3 Sep, 2008 - 03:30 PM
Post #53

New D.I.C Head
*

Joined: 3 Sep, 2008
Posts: 2

hi i just posted an item...could u help me please....
User is offlineProfile CardPM
+Quote Post

gabehabe

RE: List Of C++ Resources

4 Sep, 2008 - 01:49 AM
Post #54

Sexy DIC
Group Icon

Joined: 6 Feb, 2008
Posts: 8,864



Thanked: 177 times
Dream Kudos: 3275
Expert In: Lots of things.

My Contributions
You won't get help by just asking us to look at your thread from a pinned topic.
User is offlineProfile CardPM
+Quote Post

DoubleFission

RE: List Of C++ Resources

28 Sep, 2008 - 07:44 PM
Post #55

D.I.C Head
Group Icon

Joined: 20 Sep, 2008
Posts: 189



Thanked: 6 times
My Contributions
http://www.learncpp.com/

It's pretty good, I didn't see it mentioned on the list...
User is offlineProfile CardPM
+Quote Post

saloqbi

RE: List Of C++ Resources

25 Oct, 2008 - 01:09 AM
Post #56

New D.I.C Head
*

Joined: 25 Oct, 2008
Posts: 6

hi all
User is offlineProfile CardPM
+Quote Post

gabehabe

RE: List Of C++ Resources

25 Oct, 2008 - 06:31 AM
Post #57

Sexy DIC
Group Icon

Joined: 6 Feb, 2008
Posts: 8,864



Thanked: 177 times
Dream Kudos: 3275
Expert In: Lots of things.

My Contributions
Just updated the list with learncpp (thanks DoubleFission) and a link to this video for beginners with pointers.

User is offlineProfile CardPM
+Quote Post

cmaster

RE: List Of C++ Resources

21 Nov, 2008 - 03:55 AM
Post #58

D.I.C Head
**

Joined: 18 Nov, 2008
Posts: 53



Thanked: 2 times
My Contributions
Algorithm and Data Structure Tutorials
User is offlineProfile CardPM
+Quote Post

clock

RE: List Of C++ Resources

23 Nov, 2008 - 02:24 AM
Post #59

New D.I.C Head
*

Joined: 23 Nov, 2008
Posts: 2

Here are some more ebooks for C, C++

Data Structures and Algorithms with Object-Oriented Design Patterns in C++: http://www.brpreiss.com/books/opus4/html/book.html

Object Orientated Programming in ANSI-C: http://www.planetpdf.com/developer/article...?contentid=6635

User is offlineProfile CardPM
+Quote Post

KYA

RE: List Of C++ Resources

25 Nov, 2008 - 03:13 PM
Post #60

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 11,500



Thanked: 508 times
Dream Kudos: 2875
Expert In: C, C++, Java

My Contributions
For those of you using Visual Studio, I came across a nice tool that detects memory leaks and alerts you when the programs ends if you run in debug mode (F5).

Now, the ideal condition is that you can avoid them in the first place, however, having the resource there is always handy. README inside the zip folder is easy to read and very self explanatory.




Attached File(s)
Attached File  vld_10.zip ( 476.69k ) Number of downloads: 50
User is online!Profile CardPM
+Quote Post

5 Pages V < 1 2 3 4 5 >
Reply to this topicStart new topic

Time is now: 11/21/09 02:09PM

Live C++ Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month