Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28023

Re: ctypes - python2.7.3 vs python3.2.3

From John Gordon <gordon@panix.com>
Newsgroups comp.lang.python
Subject Re: ctypes - python2.7.3 vs python3.2.3
Date 2012-08-28 21:51 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <k1jeg9$kjc$1@reader1.panix.com> (permalink)
References <18eb8025-7545-4d10-9e76-2e41deaadb69@googlegroups.com>

Show all headers | View raw


In <18eb8025-7545-4d10-9e76-2e41deaadb69@googlegroups.com> Rolf <rolfb@personalized-books.com> writes:

> uint32_t myfunction (char ** _mydata)
> {
>    char mydata[16];

>    strcpy(mydata, "Hello Dude!");

>    *_mydata = mydata;

>    return 0;
> }

mydata is an auto variable, which goes out of scope when myfunction()
exits.  *_mydata ends up pointing to garbage.

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

ctypes - python2.7.3 vs python3.2.3 Rolf <rolfb@personalized-books.com> - 2012-08-28 14:35 -0700
  Re: ctypes - python2.7.3 vs python3.2.3 John Gordon <gordon@panix.com> - 2012-08-28 21:51 +0000
    Re: ctypes - python2.7.3 vs python3.2.3 Jan Kuiken <jan.kuiken@quicknet.nl> - 2012-08-29 23:25 +0200
      Re: ctypes - python2.7.3 vs python3.2.3 John Gordon <gordon@panix.com> - 2012-09-07 19:04 +0000
  Re: ctypes - python2.7.3 vs python3.2.3 MRAB <python@mrabarnett.plus.com> - 2012-08-28 22:59 +0100

csiph-web