473,320 Members | 2,122 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,320 software developers and data experts.

pointer?

Hi
Declaration:

XPLM_API XPLMDataRef XPLMFindDataRef(
const char * inDataRefName);

Does this return a pointer?

So I try this:

XPLMDataRef gPlaneV = NULL;

gPlaneV = XPLMFindDataRef("sim/graphics/view/view_type");

if (XPLMGetDatai(gPlaneV) != 1026)
XPLMSetDatai(gPlaneV, 1026);
But this doesn't work. If the declaration returns a pointer so how can I
set it's value ( integer ) to 1026?
Many thanks and regards
Michael

Nov 21 '08 #1
5 1931
On Nov 21, 5:16*pm, Michael Sgier <sg...@nospam.comwrote:
Hi
Declaration:

XPLM_API XPLMDataRef * * * * *XPLMFindDataRef(
* * * * * * * * * * * * * * * * * * const char * * * * * inDataRefName);

Does this return a pointer?
Sorry, I doesn't have libastral in my OS distribution. Can you provide
defenition of the type XPLMFindDataRef?
Nov 21 '08 #2
On Nov 21, 5:35*pm, maverik <maverik.m...@gmail.comwrote:
defenition of the type XPLMFindDataRef?
: D defInition

Nov 21 '08 #3
Hi
that's all I have:

http://www.xsquawkbox.net/xpsdk/phpw...XPLMDataAccess

Thanks Michael

Nov 21 '08 #4
On Nov 21, 5:49 pm, Michael Sgier <sg...@nospam.comwrote:
Hi
that's all I have:

http://www.xsquawkbox.net/xpsdk/phpw...XPLMDataAccess
From the link:

typedef void * XPLMDataRef;

So,
XPLM_API XPLMDataRef XPLMFindDataRef(const char *inDataRefName);
Does this return a pointer?
Yes.

Accroding to 7.3.1.p1 of the ISO/IEC C++ Standard (2003)

Within the scope of its declaration,
a typedef-name is syntactically equivalent to a keyword and names the
type associated with the identifier in the way described in clause 8.
A typedef-name is thus a synonym for another type. A typedef-name
does
not introduce a new type the way a class declaration (9.1) or enum
declaration does.

So you can think of XPLMDataRef as a synonym for void *
Nov 21 '08 #5
On Nov 21, 6:16*am, Michael Sgier <sg...@nospam.comwrote:
Hi
Declaration:

XPLM_API XPLMDataRef * * * * *XPLMFindDataRef(
* * * * * * * * * * * * * * * * * * const char * * * * * inDataRefName);

Does this return a pointer?

So I try this:

XPLMDataRef * * * * * * gPlaneV = NULL;

gPlaneV = XPLMFindDataRef("sim/graphics/view/view_type");

if (XPLMGetDatai(gPlaneV) != 1026)
* * * * XPLMSetDatai(gPlaneV, 1026);

But this doesn't work. If the declaration returns a pointer so how can I
set it's value ( integer ) to 1026?
What do you mean by "it doesn't work" ?
Does the code fail to compile? If so, what is the error message?

If it does compile, does it crash? If so, what error message?

If it runs, how do you know it doesn't work?

Read the documentation, which includes:
"Write a new value to an integer data ref. This routine is a no-op if
the plugin publishing the dataref is disabled, the dataref is invalid,
or the dataref is not writable."

--
Fred Kleinschmidt
Nov 21 '08 #6

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

Similar topics

4
by: Carsten Spieß | last post by:
Hello all, i have a problem with a template constructor I reduced my code to the following (compiled with gcc 2.7.2) to show my problem: // a base class class Base{}; // two derived...
110
by: Mr A | last post by:
Hi! I've been thinking about passing parameteras using references instead of pointers in order to emphasize that the parameter must be an object. Exemple: void func(Objec& object); //object...
3
by: Bruno van Dooren | last post by:
Hi All, i have some (3) different weird pointer problems that have me stumped. i suspect that the compiler behavior is correct because gcc shows the same results. ...
35
by: tuko | last post by:
Hello kind people. Can someone explain please the following code? /* Create Storage Space For The Texture */ AUX_RGBImageRec *TextureImage; /* Line 1*/ /* Set The Pointer To NULL...
16
by: junky_fellow | last post by:
According to Section A6.6 Pointers and Integers (k & R) " A pointer to one type may be converted to a pointer to another type. The resulting pointer may cause addressing exceptions if the...
204
by: Alexei A. Frounze | last post by:
Hi all, I have a question regarding the gcc behavior (gcc version 3.3.4). On the following test program it emits a warning: #include <stdio.h> int aInt2 = {0,1,2,4,9,16}; int aInt3 =...
16
by: aegis | last post by:
Given the following: int a = 10; int *p; void *p1; unsigned char *p2; p = &a;
23
by: bluejack | last post by:
Ahoy... before I go off scouring particular platforms for specialized answers, I thought I would see if there is a portable C answer to this question: I want a function pointer that, when...
69
by: fieldfallow | last post by:
Hello all, Before stating my question, I should mention that I'm fairly new to C. Now, I attempted a small demo that prints out the values of C's numeric types, both uninitialised and after...
8
by: Martin Jørgensen | last post by:
Hi, "C primer plus" p.382: Suppose we have this declaration: int (*pa); int ar1; int ar2; int **p2;
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
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)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.