473,323 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

ponteiros

Bom Dia

Gostaria de saber como eu faço para imprimir um ponteiro na linguagem
C++.

fiz algumas pesquisas e descobri que, para imprimir um ponteiro, eu
devo usar a seguinte sintaxe:

cout << "Ponteiro == " << *<n_ponteiro<< endl;

Porém, estou usando esta sintaxe, e na hora de compilar esta gerando
erro de biblioteca.

O que pode estar errado?

Obrigado

Sep 22 '06 #1
2 2448
fa***********@gmail.com wrote:
Bom Dia

Gostaria de saber como eu faço para imprimir um ponteiro na linguagem
C++.
This looks Portuguese. Have you tried any newsgroups that use that
language? Here most of the posts are made in English. If you use
English, you will get a much better response.
fiz algumas pesquisas e descobri que, para imprimir um ponteiro, eu
devo usar a seguinte sintaxe:

cout << "Ponteiro == " << *<n_ponteiro<< endl;
Why do you have 'n_ponteiro' in angle brackets? How is it declared?
If it's a pointer to int, don't use the angle brackets, don't use the
asterisk. Just put

cout << "Ponteiro == " << n_ponteiro << endl;

And if you need the value to which that pointer points, only then you
need to dereference it:

cout << "Ponteiro contents == " << *n_ponteiro << endl;
>
Porém, estou usando esta sintaxe, e na hora de compilar esta gerando
erro de biblioteca.

O que pode estar errado?
Drop the angle brackets.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Sep 22 '06 #2
falamansac...@gmail.com wrote:
Bom Dia

Gostaria de saber como eu faço para imprimir um ponteiro na linguagem
C++.

fiz algumas pesquisas e descobri que, para imprimir um ponteiro, eu
devo usar a seguinte sintaxe:

cout << "Ponteiro == " << *<n_ponteiro<< endl;

Porém, estou usando esta sintaxe, e na hora de compilar esta gerando
erro de biblioteca.

O que pode estar errado?

Obrigado
We don't communicate in Portuguese here; please use English. But
probably what you're looking for is this:

cout << "Ponteiro == "
<< static_cast<void*>( n_ponteiro )
<< endl;

Cheers! --M

Sep 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: santosh | last post by:
In following code char str = "asdf" ; str = 's' ; is possible. But char *str = "asdf" ; str = 's' ; is an run-time error. What i understand is *str = "asdf" is stored in Read-only-Memory....
3
by: pedromoises48 | last post by:
#include <stdio.h> #define MAX 100 int main() { int m, n, /* dimensoes da matriz A */ nb, p, /* dimensoes da matriz B */ i, j, k; float A, B, C; printf("Digite as dimensoes...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.