LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-01-2010, 09:30 AM   #1
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Rep: Reputation: 53
Question c++ variable type followed by *


In C++ what does the suffix, "*" mean appended to a variable type, e.g., "char* variable1;"?
 
Old 07-01-2010, 09:38 AM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by bluegospel View Post
In C++ what does the suffix, "*" mean appended to a variable type, e.g., "char* variable1;"?
Ever heard of pointers ?
 
Old 07-01-2010, 09:47 AM   #3
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Original Poster
Rep: Reputation: 53
I've heard of them, but have a vague understanding. I think when I was studying perl maybe a year ago, pointers had something to do with references to data in memory, maybe like links? I'm struggling here. I'll google this.
 
Old 07-01-2010, 09:57 AM   #4
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by bluegospel View Post
I've heard of them, but have a vague understanding. I think when I was studying perl maybe a year ago, pointers had something to do with references to data in memory, maybe like links? I'm struggling here. I'll google this.
Perl has references while C++ has both references and pointers; Perl references are different from C++ ones.

Just read a book/tutorial on "C" first, specifically studying pointers. C++ is an almost strict "C" superset, so understanding pointers in "C" will be of direct use in C++. After that it'll be easier for you to grasp references.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Python variable type MTK358 Programming 6 12-08-2009 04:11 AM
error: variable ‘fops’ has initializer but incomplete type rajkumar_halle Programming 1 08-24-2008 08:57 AM
C++ variable type trick... ArthurHuang Programming 4 02-15-2008 07:41 PM
understand variable type in shell script qrshat Programming 5 09-09-2006 02:12 AM
make.conf in Gentoo linux, cpu type variable question.. bacium Linux - Software 1 05-11-2005 11:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration