Development

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Help on Swig

    0 answers - 956 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi,
    I am facing a problem with swig while using Pointers:
    <Array.c>
    #include<stdio.h>
    void Array(int *ptr)
    {
    int i;
    for (i = 0; i < 6; i++)
    {
    printf("Index: %d - %d\n",i, *(ptr + i));
    }
    }
    <Array.i>
    %module Array
    %{
    extern void Array(int *ptr);
    #include<stdio.h>
    %}
    extern void Array(int *ptr);
    While running:
    import Array
    a=[1,3,2,4,5,6,7,9]
    Array.Array(a)
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    TypeError: argument number 1: a 'int *' is expected, 'list([1, 3, 2, 4, 5, 6, 7, 9])' is received
    Do I need to make some changes in Interface file?
    Also I need to return that array after sorting it. How do I return it and collect the same in python.
    Thanks and Regards,
    Cheers!
    `.(*.(`. .).*).`
    [ Garry ]
    `.(.*(. `.)*.).`
    Blogging at

Re: Help on Swig


max 4000 letters.
Your nickname that display:
In order to stop the spam: 7 + 6 =
QUESTION ON "Development"

EMSDN.COM