Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

Pointers in C++

 
webmaster forum
Activity
0%
 
New Coder
Posts: 24
Topics: 21
July 24, 2009, 03:22:59 AM

Well, besides pointers in C++ most of the java objects are similar to that of C++. Java programming doesnot have pointers. In C++, the two basic things of pointers are & referrence operator and * operators. It is related to the address or memory location to a variable.
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
July 24, 2009, 03:28:18 AM

Java programming doesnot have pointers.

Arguably Java does have pointers - it is just the programmer is hidden from them somewhat and can not do interesting things such as pointer arithmetic. For instance, in Java

String mystring=new String("Hello");

The variable "mystring" points to the string object containing characters Hello, at a lower level of abstraction it points to the memory holding this string just like C++, you can even repoint this by mystring=new String("a new string"). The automatic garbage collector in Java will then recognise the original string is no longer being pointed to and hence of no use and will free the memory for some other usage.

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
Activity
0%
 
Regular Coder
Posts: 53
Topics: 2
August 03, 2009, 09:20:39 PM

It's not arguably, Java does have pointers. I'm tired of people saying it doesn't. They're there. They're a pain because you can't touch them. It's misleading to say they aren't there, because almost every variable in Java is a pointer.
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
August 04, 2009, 04:15:21 AM

It's not arguably, Java does have pointers

Depends on the programmer's level of abstraction

Almost every variable in Java is a pointer.

Apart from the primitives Wink
« Last Edit: August 04, 2009, 04:30:48 AM by polas »

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
Activity
0%
 
Regular Coder
Posts: 53
Topics: 2
August 04, 2009, 07:02:59 AM

This is why I say almost.

The biggest annoyance to me in Java is the inability to overload operators. I want == to work for strings, I don't want to have to use .equals(). I think it's just something that I'm accustomed to being able to take advantage of and when I don't have it I feel like I'm being restricted.
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
August 04, 2009, 07:13:08 AM

This is why I say almost.

I know Wink

The biggest annoyance to me in Java is the inability to overload operators. I want == to work for strings, I don't want to have to use .equals(). I think it's just something that I'm accustomed to being able to take advantage of and when I don't have it I feel like I'm being restricted.

Yes I agree it would be very helpful (== checking pointer equality rather than value equality of objects has often confused the students I have taught a great deal) I can see how from a C++ background that would be a major want for the language. Personally, as  C programmer and being in that mindset, I often find myself writing Java and thinking "if only I could use pointer arithmetic I could save myself so much time, effort and the code would be very elegant"

Oh well, I suppose we can not have everything!

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
Activity
0%
 
New Coder
Real name: josaph...
Location: Usa...
Posts: 17
Topics: 2
WWW
July 17, 2010, 12:23:37 AM

Pointers to Member Functions are one of C++'s more rarely used method and are often not well unwritten even by experienced developers. A pointer is a variable that is used to store a memory address. The address is the position of the variable in the memory. Pointers help in distribute memory enthusiastically. Pointers improve completing time and saves space.  Pointer points to a particular data type. The general form of declaring pointer is:-
 type *variable_name;
 

No Fee Work at Home |Data Entry |Work from home
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
August 01, 2010, 05:48:01 AM

Function pointers also exist within C....

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
maha66  Offline
Activity
0%
 
New Poster
Posts: 2
Topics: 0
August 01, 2010, 08:50:49 PM

Pointers do not have a default value in C/C++.  They are called wild! It means that they point to some unknown random location, and if it is for example an integer pointer (int*), it is not even guaranteed the the location pointed to by a pointer initially is occupied by an integer data.
« Last Edit: August 28, 2011, 05:38:25 AM by Admin »
 
webmaster forum
Activity
0%
 
New Coder
Posts: 15
Topics: 0
March 09, 2011, 12:40:28 PM

C + +, the pointer is a variable that stores the memory address.  Each store has an associated storage location address.  Pointer is a variable, which holds the address, also called a pointer variable.  C + + programmers are forced to work in the pointer, so they used a pointer to their code.

dell coupons codes
 
webmaster forum
Activity
0%
 
New Coder
Posts: 18
Topics: 0
March 14, 2011, 11:50:48 PM

Pretty useful post,, left me asking for more!!. .

Tech Blog
 
webmaster forum
Activity
0%
 
Skilled Coder
Posts: 125
Topics: 0
March 15, 2011, 01:59:16 AM

Yes, Pointer is a very powerful of the C++ language that has many uses in advanced programming. There are main two operator in pointer, Which are given below.

- Reference Operator(&).
- Dereference Operator(*).

Network Management Service
 
webmaster forum
poster  Offline
Activity
0%
 
New Coder
Posts: 20
Topics: 0
WWW
March 18, 2011, 12:24:03 AM

We could probably use a few more pointers that discuss more specific issues. Repetition is the key to learning. So long as the information is accurate, I have no problem with some redundancy.

Equity research training
 
webmaster forum
Activity
0%
 
New Coder
Posts: 20
Topics: 2
April 13, 2011, 02:12:15 PM

The variable "mystring" points to the string object containing characters Hello, at a lower level of abstract entity it points to the memory holding this string just like C++, you can even point this by mystring=new String

cabinet doors | games | de-duplication software
 
webmaster forum
Activity
0%
 
New Coder
Posts: 25
Topics: 1
WWW
April 20, 2011, 09:01:25 PM

Pointers are there in C# but they are not used because they can point to location which is out of CLR. same MAY BE CASE WITH jAVA

Nursing Assistant | Nursing Assistant Job | Nursing Assistant Salary
 
webmaster forum
Activity
0%
 
New Coder
Posts: 25
Topics: 2
April 26, 2011, 12:44:55 PM

Drinkable programming doesnot bang pointers.  In C++, the two commodity things of pointers are & referrence opportunist and * operators.  It is affine to the come or memory activity to a multivariate.

Karaoke Microphone | speed bag platform | tennis net
 
webmaster forum
Activity
0%
 
New Poster
Posts: 6
Topics: 0
May 03, 2011, 04:55:31 PM

Pointers are a part of C++ programming that can cause grief though not as much as in C, where to do anything non trivial you have to use pointers.  It is a capricious that is used to store a  memory address Pointers are not that bad, but if you are new to them they will could could cause you troubles.  It is all to simple to address bad code with pointers.
 
webmaster forum
mak14317  Offline
Activity
0%
 
Skilled Coder
Real name: Janne
Location: california
Gender: Male
Age: 26
Posts: 108
Topics: 1
WWW
May 03, 2011, 10:20:53 PM

A pointer is a variable that is used to store a memory address. The address is the location of the variable in the memory. Pointers help in allocating memory dynamically. Pointers improve execution time and saves space.  Pointer points to a particular data type. The general form of declaring pointer is:-

 

            type *variable_name;

herbal vaporizer
Happy vappy vaporizer
Eclipse Vape
Ivape
 
webmaster forum
Radhaa  Offline
Activity
0%
 
New Poster
Posts: 5
Topics: 0
May 10, 2011, 03:00:10 AM

The following is a simple example of the use of pointers. . .

int &variable1Label = variable1;
    variable1Label = 101;
    cout << "The value of integer1 after assigning a value "
    << "to the label is now: " << variable1 << endl << endl;


I'm not really understanding it, though.  How does it actually work? I have referred to the tutorial on this site, but am still unsure.  
« Last Edit: May 10, 2011, 08:16:30 PM by Admin »
 
webmaster forum
msdnguide  Offline
Activity
0%
 
New Coder
Posts: 19
Topics: 1
WWW
May 27, 2011, 04:35:22 AM

every variable in java is a pointer

Visual Studio
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page February 03, 2012, 02:39:24 AM