gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] How to extract a variable value of cob_field f_nn in


From: henry wang
Subject: [open-cobol-list] How to extract a variable value of cob_field f_nn in translated c?
Date: Sat Dec 17 08:58:03 2005

Hi Roger,
 
There is a difficult thing for me:
a variable in Cobol  program
 01  COB_VAR1 PIC S9(0006)V PACKED-DECIMAL.
this Cobol  program was traslanted to c file, i got the following in .h file:
...
static unsigned char b_10[4];  /* COB_VAR1  */
...
static cob_field f_10 = {4, b_10, &a_12}; /* COB_VAR1  */
Now i want to extract  a variable value of f_10 in traslanted c file, then passing it as parameter,following lines have been added in traslanted c file.
float p1;
unsigned char char_p1[4];
cob_memcpy (&f_10, char_p1, 4);
p1= atof(char_p1);
But "Segmentation fault (core dumped)" occurred at cob_memcpy (&f_10, char_p1, 4);
Could you guide me about it?
Thank you very much in advance!
 
Henry

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]