Home
Calendar
Certifications
Columns
Features
Forum
Resources
Vitals
Latest Additions
April 2013 Free Giveaway Sponsor - eLearnSecurity
Human Intelligence to Navigate the Security Data Deluge
February 2013 Free Giveaway Winner of SANS CyberCon Training
Interview: Bugcrowd Founders on Herding Ninjas for Crowdsourced Bug Bounties
Network Forensics: The Tree in the Forest
March 2013 Free Giveaway Sponsor - Mile2
Book Review: Violent Python
February 2013 Free Giveaway Sponsor - SANS
Holiday 2012 Free Giveaway Winner of Metasploit Pro by Rapid7
Course Review: SANS FOR408 Computer Forensic Investigations – Windows In-Depth
The Security Consulting Sugar High
Tutorial: Fun with SMB on the Command Line
Interview: Ilia Kolochenko, CEO of High-Tech Bridge
October 2012 Free Giveaway Winner of LearningGate Training
The Broken: Assessing Corporate Security in 2012 to Make a Better 2013
EH-Net Login
Welcome Guest.
Username:
Password:
Remember me
Lost Password?
No account yet?
Register
Who's Online
We have 29 guests online
You are here:
Home
Ethical Hacking Discussions and Related Certifications
Programming
Learning C++
EH-Net
May 21, 2013, 06:57:14 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Go back to The Ethical Hacker Network Online Magazine
Home Page
Home
Help
Calendar
Login
Register
EH-Net
>
Ethical Hacking Discussions and Related Certifications
>
Programming
(Moderator:
don
) >
Learning C++
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Learning C++ (Read 5886 times)
0 Members and 1 Guest are viewing this topic.
MatP
Newbie
Offline
Posts: 37
Learning C++
«
on:
August 19, 2010, 11:28:25 AM »
Hey
So I'm in the process of learning C++. I have a small problem though.
I find it difficult at times to understand the point of pointers. Perhaps it's simply the textbook I am using doesn't provide a good explanation or a good example. I just can't think of any reason I'd want to use them in a program I was creating myself.
Now I'm sure there must be plenty of reasons out there as I've seen them in examples of other code so I'm wondering if anyone has a good resource to teach this aspect of programming or could provide an example problem that requires a solution using pointers?
Thanks for the help!
Logged
Please visit
Discovering Information Security
today!
Equix3n-
Sr. Member
Offline
Posts: 386
Re: Learning C++
«
Reply #1 on:
August 19, 2010, 11:52:18 AM »
Have you ever tried to pass an array as an argument to a function? How do you do this?<-- Think on this for a moment, and try to find a solution for it.
Also, how do you allocate dynamic memory?
I learned C programming (I'm not very good at C++ though I can read and understand the code) and especially pointers from a lot of books and online articles, so I can't direct you to any absolute resource. However, a good starting point will be to clear your concepts pertaining to arrays and strings and how they're stored in memory and then move to pointer. Learn all about pointers,pointers to arrays/strings, array of pointers (different form pointer to arrays), function pointers, pointers to other datatypes and try to compare how using a pointer is different from using that variable in a normal way. At each point try to visualize what's happening in the memory.
Here are some resource which might help you.
http://www.cprogramming.com/tutorial/lesson6.html
http://www.augustcouncil.com/~tgibson/tutorial/ptr.html
http://c-faq.com/ptrs/index.html
http://c-faq.com/malloc/index.html
http://c-faq.com/aryptr/index.html
Logged
zeroflaw
Full Member
Offline
Posts: 208
Re: Learning C++
«
Reply #2 on:
August 19, 2010, 12:47:00 PM »
With pointers you have full control over the memory in your program. Also sometimes you need to work with memory addresses, they can be stored in pointers.
And like Equix3n said, how do you allocate dynamic memory? Or how do you access newly allocated memory? You need pointers for this. It's also needed when implementing polymorphism in your program. You have different types of objects, and sometimes you don't know the type in advance or want to change it. You can have your pointer point to a different type of object then.
There are also lots of functions from different API's that need pointers as arguments.
Logged
ZF
MatP
Newbie
Offline
Posts: 37
Re: Learning C++
«
Reply #3 on:
August 20, 2010, 08:55:23 AM »
Thanks for the help guys
I appreciate it. I will definitely take a look at those links over the next few days.
I hadn't considered a lot of what you've given me. I'm still fairly new to C++ (and programming in general, haven't done anything beyond beginner stuff before) so there are a number of concepts still quite foreign to me. Anyway, I will continue reading/learning!
Thanks!
Logged
Please visit
Discovering Information Security
today!
Equix3n-
Sr. Member
Offline
Posts: 386
Re: Learning C++
«
Reply #4 on:
August 22, 2010, 07:59:57 AM »
You might also want to consider the following free lectures from Stanford.
CS106-B Programming Abstractions: Teaches C++ programming. Natural successor to CS106-A which teaches programming methodology in Java
http://see.stanford.edu/see/lecturelist.aspx?coll=11f4f422-5670-4b4c-889c-008262e09e4e
http://www.youtube.com/user/stanforduniversity?blend=2&ob=4#g/c/FE6E58F856038C69
CS106-A Programming Methodology
http://see.stanford.edu/see/lecturelist.aspx?coll=824a47e1-135f-4508-a5aa-866adcae1111
http://www.youtube.com/user/stanforduniversity?blend=2&ob=4#g/c/84A56BC7F4A1F852
I haven't gone through both of the above, but I checked the first video of CS106A and I guess you'll be fine if you jump straight into CS106B.
I'm currently going through CS107. Excellent stuff. It's a must if you want to learn some advanced programming basics. Highly recommended. It basically teaches what happens under the hood, so don't study from it if don't already know basic C/C++.
CS107 Programming Paradigms
http://see.stanford.edu/see/lecturelist.aspx?coll=2d712634-2bf1-4b55-9a3a-ca9d470755ee
http://www.youtube.com/user/stanforduniversity?blend=2&ob=4#g/c/9D558D49CA734A02
Edit: Just found a really good paper or Pointers. Do read it.
cslibrary.stanford.edu/102/PointersAndMemory.pdf
«
Last Edit: August 22, 2010, 11:41:38 PM by Equix3n-
»
Logged
MatP
Newbie
Offline
Posts: 37
Re: Learning C++
«
Reply #5 on:
August 23, 2010, 09:24:20 AM »
Awesome, I will definitely look over all of those videos/the paper linked when I'm at home and have some time. Thanks for the links and all the resources you've provided so far. Slowly but surely I'll figure this stuff out and get into more advanced concepts
Logged
Please visit
Discovering Information Security
today!
MatP
Newbie
Offline
Posts: 37
Re: Learning C++
«
Reply #6 on:
August 23, 2010, 01:09:57 PM »
So I've read over some of the content you linked in your first post Equix3n- and I've got to say that the text book I'm reading, which has been mostly pretty good, is really terrible at explaining the concept of pointers.
Thanks so much for your links
Logged
Please visit
Discovering Information Security
today!
Equix3n-
Sr. Member
Offline
Posts: 386
Re: Learning C++
«
Reply #7 on:
August 23, 2010, 01:15:50 PM »
Which book are you referencing?
Logged
MatP
Newbie
Offline
Posts: 37
Re: Learning C++
«
Reply #8 on:
August 23, 2010, 02:11:02 PM »
A First Book of C++, From Here to There
Logged
Please visit
Discovering Information Security
today!
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
EH-Net
-----------------------------
=> Calendar Of Events
===> ChicagoCon 2007
===> ChicagoCon 2008s
===> ChicagoCon 2008f
===> ChicagoCon 2009s
=> Ethical Hacktivism
=> News Items and General Discussion About EH-Net
===> Greetings
=> Special Events
-----------------------------
Ethical Hacking Discussions and Related Certifications
-----------------------------
=> General Certification
===> Networking
===> OS
===> Security
=> Compliance, Regulations & Standards
=> Control Systems
=> Cyber Warfare
=> Forensics
===> CCE / MCCE - (Master) Certified Computer Examiner
===> CHFI - Computer Hacking Forensic Investigator
===> EnCE - EnCase® Certified Examiner
===> GCFA - GIAC Certified Forensics Analyst
=> Hardware
=> Incident Response
===> CSIH - Computer Security Incident Handler
===> GCIH - GIAC Certified Incident Handler
=> Malware
===> Advisories
=> Mobile
=> Network Pen Testing
===> CEH - Certified Ethical Hacker
===> CPTC - Certified Penetration Testing Consultant
===> CPTE - Certified Penetration Testing Engineer
===> CSTA - Certified Security Testing Associate
===> eCPPT - eLearnSecurity Certified Professional Penetration Tester
===> ECSA - EC-Council Certified Security Analyst
===> GPEN - GIAC Certified Penetration Tester
===> OSCP - Offensive Security Certified Professional
=> Physical Security
=> Programming
=> Social Engineering
=> Web Applications
=> Wireless
===> CWNP Certs
===> GAWN - GIAC Assessing Wireless Networks
===> OSWP - Offensive Security Wireless Professional
=> Other
-----------------------------
Columns
-----------------------------
=> Editor-In-Chief
=> Andress
=> Gates
=> Haddix
=> Hadnagy
=> Heffner
=> Hoffman
=> Linn
=> RichM
=> Murray
=> J. Peltier
=> Weidman
=> Wilson
-----------------------------
Features
-----------------------------
=> /root
=> Book Reviews
=> Opinions
=> Skillz
===> Examples
===> May 06 - Star Hacks, Episode V: The Empire Hacks Back
===> July 06 - Hack Bill!
===> Sept 06 - Netcat in the Hat
===> Nov 06 - Hitch-Hackers Guide to the Galaxy
===> Dec 06 - A Christmas (Hacking) Story
===> Feb 07 - Charlottes Web Site
===> April 07 - Microsoft Office Space
===> June 07 - Serenity Hack
===> Oct 07 - Worst. Ethical. Hacker. Challenge. Ever.
===> Dec 07 - Frosty the Snow Crash
===> March 2008 - It Happened One Friday
===> Oct 2008 - Scooby Doo and the Crypto Caper
===> Dec 08 - Santa Claus Is Hacking to Town
===> Feb 2009 - Brady Bunch Boondoggle
===> July 2009 - Prison Break
===> October 2009 - SSHliders
===> December 2009 - Miracle on Thirty-Hack Street
===> December 2010 - The Nightmare Before Charlie Browns Christmas
-----------------------------
Resources
-----------------------------
=> Career Central
===> Looking For Work
===> Looking To Hire
=> Links to cool sites.
=> Mass Media
=> News from the Outside World
=> Tools
=> Tutorials
===> Tutorial Requests
Loading...
Exclusive Deal
SANSFIRE 2013
June 15 - 22
5% Off
w/ Code
:
EHN_5
SANS Deals 4 EH-Netters
5% OFF
Any
SANS Course
in Any Format!
Coupon Code:
EHN_5
Including
SANS Rocky Mountain 2013
&
SANS Boston 2013
Polls
Compared to this year, 2013 will be:
Great!
Better.
About the same.
Little worse.
FUBAR!
Recent Forum Topics
Other
: Design of artificial intelligence must read
(0) by
jkaluza
Programming
: Finished Python Course in Codecademy now what?
(13) by
securitian
Network Pen Testing
: Ruby on Rails Vulnerabilities/Attacks in BackTrack 5 r3
(0) by
SUdoctstudent
Network Pen Testing
: De-ICE 1.140 released!
(2) by
superkojiman
Network Pen Testing
: AIX Vulnerability Assessments
(1) by
3xban
General Certification
: CPT Practical Submission
(1) by
UNIX
OSCP - Offensive Security Certified Professional
: Failed my first attempt at the OSCP exam
(94) by
azmatt
Tools
: Social-Engineer Toolkit (SET) Version 5.0 “The Wild West” Released
(2) by
m0wgli
Malware
: EICAR?
(3) by
UKSecurityGuy
Advisories
: HTB23154: Multiple Vulnerabilities in Exponent CMS
(0) by
AndyP
Advisories
: HTB23153: Multiple Vulnerabilities in Jojo CMS
(0) by
AndyP
Advisories
: HTB23151: Cross-Site Request Forgery (CSRF) in UMI.CMS
(0) by
AndyP
Tutorials
: Need guidance
(8) by
r0ckm4n
OSCP - Offensive Security Certified Professional
: Class Scheduled 6/8 - Linux n00b
(7) by
Taemyks
OSCP - Offensive Security Certified Professional
: OSCP exam scheduled
(6) by
gbhat
Incident Response
: LinkedIn Forensics
(0) by
AFENTIS_Forensics
General Certification
: Red Team/Blue Team
(1) by
ajohnson
Career Central
: Starter cert?
(3) by
Grendel
Network Pen Testing
: Beginner Ethical Hacker
(1) by
m0wgli
Web Applications
: Nessus and Nikto
(4) by
Seen
Network Pen Testing
: Cracking salted MD5 hash
(4) by
n37sh@rk
CEH - Certified Ethical Hacker
: Passed my C|EH
(3) by
n37sh@rk
Mass Media
: EC-council hacked, irony at his best?
(0) by
j0rDy
Web Applications
: SQL Injection into an INSERT statement.
(6) by
eyenit0
Network Pen Testing
: Solution for sipXtapi INVITE Message CSeq Field Header Remote Overflow
(1) by
m0wgli
Web Applications
: dns
(2) by
H1t M0nk3y
Other
: BSides Boston
(0) by
3xban
Career Central
: InfoSec in Central, FL
(2) by
tturner
Web Applications
: Web vulnerability scanner
(4) by
H1t M0nk3y
EH-Net News Feeds
Latest Additions
Privacy Notice
for TDCC & All Properties
© 2013 The Ethical Hacker Network
Joomla!
is Free Software released under the GNU/GPL License.