Sponsored Content
Top Forums Programming Problem with function which reutrns pointer to a value Post 87618 by jazz on Wednesday 26th of October 2005 10:12:58 AM
Old 10-26-2005
Question Problem with function which reutrns pointer to a value

i have a function:
char *pcCityIdToCountryName(ADMIN_DB_DATA *pstHEader, unit uiCityID)

this returns a pointer to CountryName if cityId is given.
to retrieve countryname i give:

char *CountryName;
CountryName = pcCityIdToCountryName(..................);

but when i compile it is giving :
Unresolved
pcCityIdToCountryName

Iam new to C programming. Please help
 

10 More Discussions You Might Find Interesting

1. Programming

pointer problem

could any one tell why the following is showing segmentation fault while using **ptr but working fine using **a #include<stdio.h> ... (1 Reply)
Discussion started by: useless79
1 Replies

2. Programming

How to return void function pointer

Hello all im trying to build function that will return void function pointer what is mean is ( not working ) the main function void * myClass::getFunction(int type){ if(type==1) return &myClass::Test1; if(type==2) return &myClass::Test2; } void myClass::Test1(){... (1 Reply)
Discussion started by: umen
1 Replies

3. Programming

pass a pointer-to-pointer, or return a pointer?

If one wants to get a start address of a array or a string or a block of memory via a function, there are at least two methods to achieve it: (1) one is to pass a pointer-to-pointer parameter, like: int my_malloc(int size, char **pmem) { *pmem=(char *)malloc(size); if(*pmem==NULL)... (11 Replies)
Discussion started by: aaronwong
11 Replies

4. Programming

Function pointer to inline function ?

Hi. Problem: I have to parse the payload of a packet. The payload could be in Big Endian Format (network byte order) or little. That depends on a flag present in the header of the packet. Solution: A horrible solution could be to check for that flag everytime I have to read a field in the... (11 Replies)
Discussion started by: emitrax
11 Replies

5. Programming

Function Returning Pointer

Hi guys. how a functions such fdopen, ... can return pointer? are these functions use static memory(variables)? (6 Replies)
Discussion started by: majid.merkava
6 Replies

6. Programming

structure pointer array as function parameters

if i create an array of pointers to a structure "struct node" as: struct node *r; and create "n" number of "linked lists" and assign it to the various struct pointers r using some function with a return type as structure pointer as: r=multiplty(.......) /*some parameters*/ is... (2 Replies)
Discussion started by: mscoder
2 Replies

7. Programming

Trivial doubt about C function pointer

Hi, In the below C code, #include <stdio.h> void print() { printf("Hello\n"); } int main() { void (*f)() = (void (*)()) print; f(); (*f)(); } I wonder, how the syntaxes "f()" and "(*f)()" are treated as same without any error? Is this an improvement or ANSI/ISO... (1 Reply)
Discussion started by: royalibrahim
1 Replies

8. Programming

pointer problem

Does anyone know? int x = 1; int *p = &++x; //ok ! int *q = &x++; //gives an error :O why the first pointer is ok but the second is an error? (13 Replies)
Discussion started by: nishrestha
13 Replies

9. Programming

Pure C function pointer on printing vowels twice

Have difficulty to understand this pure C code to only print vowels twice from input string. Questions are commented at the end of each place. #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <limits.h> /* *Demonstrate the use of dispatch tables */ /*Print a char... (11 Replies)
Discussion started by: yifangt
11 Replies

10. Programming

Segmentation fault when I pass a char pointer to a function in C.

I am passing a char* to the function "reverse" and when I execute it with gdb I get: Program received signal SIGSEGV, Segmentation fault. 0x000000000040083b in reverse (s=0x400b2b "hello") at pointersExample.c:72 72 *q = *p; Attached is the source code. I do not understand why... (9 Replies)
Discussion started by: jose_spain
9 Replies
gii_cmddata_getvalinfo(3)						GGI						 gii_cmddata_getvalinfo(3)

NAME
gii_cmddata_getvalinfo, gii_phystype, gii_valrange - GII valuators description SYNOPSIS
#include <ggi/events.h> typedef struct gii_valrange { int32_t min, center, max; } gii_valrange; typedef struct { uint32_t number; char longname[75]; char shortname[5]; gii_valrange range; gii_phystype phystype; int32_t SI_add,SI_mul,SI_div,SI_shift; } gii_cmddata_getvalinfo; DESCRIPTION
This structure is used to describe the values reported by a specific valuator. STRUCTURE MEMBERS
gii_cmddata_getvalinfo fields are defined as follow: number Number of the queried valuator. longname A human-redable NULL terminated string identifying the valuator. shortname A NULL terminated abbreviated name for this valuator. range Contains the minimum, center and maximum values for this valuator. Note that this range may change on some devices due to calibra- tion, but it is usually not expected that a device recalibrates while in use. You should react gracefully to values received from the valuator that are outside the specified range, though. phystype Gives the physical quantity the device measures. The idea is to report the thing the user actually controls. I.e. a Joystick actu- ally measures resistance, but should report GII_PT_ANGLE or GII_PT_FORCE, as that is what the user does to the stick and what results in the changed resistance. SI_add, SI_mul, SI_div, SI_shift Using these values, it is possible to give calibration data to the application or to compute the actual floating point value (in the unit expressed in phystype) reported by the valuator with the following formula: (float)(SI_add + value) * (float)SI_mul / (float)SI_div * pow(2.0, SI_shift); PHYSICAL UNITS
The following physical units are defined for gii_phystype: o GII_PT_UNKNOWN : unknown o GII_PT_TIME : base unit s (second) o GII_PT_FREQUENCY : base unit 1/s (Hz) o GII_PT_LENGTH : base unit m (meter) o GII_PT_VELOCITY : base unit m/s o GII_PT_ACCELERATION : base unit m/s^2 o GII_PT_ANGLE : base unit radian o GII_PT_ANGVELOCITY : base unit radian/s o GII_PT_ANGACCELERATION : base unit radian/s^2 o GII_PT_AREA : base unit m^2 o GII_PT_VOLUME : base unit m^3 o GII_PT_MASS : base unit kg o GII_PT_FORCE : base unit N (kg*m/s^2) o GII_PT_PRESSURE : base unit N/m^2 (Pa) o GII_PT_TORQUE : base unit Nm o GII_PT_ENERGY : base unit Nm, VAs, J o GII_PT_POWER : base unit Nm/s, VA, W o GII_PT_TEMPERATURE : base unit K o GII_PT_CURRENT : base unit A o GII_PT_VOLTAGE : base unit V (kg*m^2/(As^3)) o GII_PT_RESISTANCE : base unit V/A (Ohm) o GII_PT_CAPACITY : base unit As/V (Farad) o GII_PT_INDUCTIVITY : base unit Vs/A (Henry) SEE ALSO
giiQueryValInfo(3) libgii-1.0.x 2006-12-30 gii_cmddata_getvalinfo(3)
All times are GMT -4. The time now is 10:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy