Queens, New York
Online
Edison Member
Karma: 29
Posts: 1578
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« on: January 25, 2013, 09:13:14 am » |
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
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #1 on: January 25, 2013, 09:26:16 am » |
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.
|
|
|
|
New Jersey
Offline
Edison Member
Karma: 24
Posts: 2353
|
 |
« Reply #2 on: January 25, 2013, 09:48:36 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Offline
God Member
Karma: 9
Posts: 836
|
 |
« Reply #3 on: January 25, 2013, 10:07:58 am » |
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
Full Member
Karma: 10
Posts: 223
When the going gets weird, the weird turn pro. - Hunter S. Thompson
|
 |
« Reply #4 on: January 25, 2013, 10:11:20 am » |
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
Online
Faraday Member
Karma: 41
Posts: 5174
CMiYC
|
 |
« Reply #5 on: January 25, 2013, 10:47:42 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Online
Edison Member
Karma: 29
Posts: 1578
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #6 on: January 29, 2013, 08:29:31 am » |
@Jimmy60 Sorry im just now getting back to my own post. Thanks Jimmy, that site is awesome.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Central MN, USA
Offline
Faraday Member
Karma: 35
Posts: 5936
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
|
 |
« Reply #7 on: January 29, 2013, 08:37:50 am » |
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
Online
Edison Member
Karma: 29
Posts: 1578
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #8 on: January 29, 2013, 08:53:36 am » |
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
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Central MN, USA
Offline
Faraday Member
Karma: 35
Posts: 5936
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
|
 |
« Reply #9 on: January 29, 2013, 11:28:37 am » |
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
Online
Edison Member
Karma: 29
Posts: 1578
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #10 on: January 29, 2013, 11:42:08 am » |
@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
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Central MN, USA
Offline
Faraday Member
Karma: 35
Posts: 5936
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
|
 |
« Reply #11 on: January 29, 2013, 12:04:39 pm » |
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
|
|
|
|
|
|