Pages: [1]   Go Down
Author Topic: Crash coarse on pointers and references  (Read 552 times)
0 Members and 1 Guest are viewing this topic.
Queens, New York
Offline Offline
Faraday Member
**
Karma: 65
Posts: 2934
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Im trying to understand pointers and De/references, can anyone give me a good detailed explanation on them? Ive tried wiki and some other sites, but I still can't get a good grasp of them. Can anyone help me?
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 239
Posts: 24371
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A pointer is just an address.

If I write "2115 West Street" on a scrap of paper, I haven't given you a house, I've given you a reference to a house.
« Last Edit: January 25, 2013, 09:28:35 am by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

New Jersey
Offline Offline
Faraday Member
**
Karma: 49
Posts: 3420
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's a link with a number of different explanations: http://programmers.stackexchange.com/questions/17898/whats-a-nice-explanation-for-pointers
Logged

Offline Offline
Edison Member
*
Karma: 28
Posts: 2045
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are thousands of books on  how C style languages work,  including some online for free.

I suggest you acquire one and read it.   Do you really expect us to sit here and manually type
out a few chapters of a programming text book for you ?
Logged

Saskatchewan
Offline Offline
Sr. Member
****
Karma: 15
Posts: 348
When the going gets weird, the weird turn pro. - Hunter S. Thompson
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.cplusplus.com/doc/tutorial/

One of the better tutorials you'll find. There's a good section on pointers. Great site for language reference as well.
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 64
Posts: 6055
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm a fan of: http://pweb.netcom.com/~tjensen/ptr/cpoint.htm

I keep a copy of his PDF to review whenever I start using pointers:
http://home.earthlink.net/~momotuk/pointers.pdf
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Queens, New York
Offline Offline
Faraday Member
**
Karma: 65
Posts: 2934
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@Jimmy60
Sorry im just now getting back to my own post. Thanks Jimmy, that site is awesome.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6908
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Get a book! You don't know pointers then you don't know much of C. Time to do C 101.
Schildt
http://www.herbschildt.com/
Logged


Queens, New York
Offline Offline
Faraday Member
**
Karma: 65
Posts: 2934
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
You don't know pointers then you don't know much of C.
I didn't know anything about programming before college, to be honest, I wanted nothing to do with programming. Originally I thought I was just going for electrical engineering, but they told me I had to learn programming too. So whatever the professor taught is what I learned, and we did not cover pointers.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6908
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
You don't know pointers then you don't know much of C.
I didn't know anything about programming before college, to be honest, I wanted nothing to do with programming. Originally I thought I was just going for electrical engineering, but they told me I had to learn programming too. So whatever the professor taught is what I learned, and we did not cover pointers.

Every science and engineering major should learn a course in C. It's just that necessary. A considerable portion of ECE is computer engineering, developing firmwares with hardware and software knowledge. Most senior ECE projects/proposals I've seen so far have some programming elements. You probably took an intro to programming course but should have been better off with intro to C, which by goud, covers pointers. I recommend C from ground up (don't know if it's still in print or replaced by C++ from ground up).
Logged


Queens, New York
Offline Offline
Faraday Member
**
Karma: 65
Posts: 2934
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@liudr

In my 4 years of college, I had to learn Assembly, Basic, C, C++, C#, Java, HTML5, and XML, all without any prior knowledge going into college. Except basic, I learned that from making programs on my graphing calculator. We learned only what we needed to know (absolutely necessary), to get us by. So within that time, I think I did ok.

Keep in mind that I didn't have ANY programming class my entire first year. Yet I walked away with a Bachelors degree in Electrical and Computer Engineering, and I plan to go back for my masters.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6908
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

HazardsMind,

But pointers knowledge is THE MOST IMPORTANT of C. I'm appalled at this strange combo of vast programming knowledge you possess and the absence of pointers. Of course, you only learned what you needed for your degree, which may not involve using pointers. I learned C and other languages on my own (reading books in the 80s and 90s) too, before college but my college course had C so I did go through pointers in a formal class. If you want to learn and master it, you need to get the intro to C or something and patch up this hole. Assembly was good. At least you don't have to teach yourself about memory structure like others do.

I'm not trying to make you look bad or novice. I know nothing about your background till now. All I was doing was pointing out a good intro book. To anyone that knows nothing about pointers or else, I find reading a book is a thousand times better than reading off bits and bytes off the net. You don't get that systematic teaching and exercises as a book would give you and Schildt is my favorite author. What's rush to whiplash on a good recommendation? I'm not interested in arguing with you either on your thread or with PMs. You don't like it, just ignore then.
Logged


Pages: [1]   Go Up
Jump to: