|
From: Derek C. <de...@ci...> - 2009-03-05 22:46:46
|
Forgot to reply all to include the group!
---------- Forwarded message ----------
From: Derek Clarke <de...@ci...>
Date: Thu, Mar 5, 2009 at 10:45 PM
Subject: Re: [Dev-C++] Tokenize function
To: Alexsandro Meireles <mei...@gm...>
Can you tell us what's inside the tokenizar function?
Also the code you have published doesn't match the results you report
- you are obviously printing the words in a loop, so where's the loop
in main?
On Thu, Mar 5, 2009 at 11:36 AM, Alexsandro Meireles
<mei...@gm...> wrote:
> Dear all,
>
> I have build a function to tokenize a sentence and to return the words in my
> main function. It seems ok, but it's not working the way I intend.
>
> The code is:
>
> main()
> {
> char str[50];
> char *array[50];
> printf("Token 0.1\nDeveloped by Alexsandro Meireles\nType");
> printf(" the sentence: ");
> gets(str);
> tokenizar(str);
> printf("\n");
> printf("Word #%d is %s\n",0, array[0]); //PROBLEM IS HERE!!!!!
> system("pause");
> }
>
>
> I need to have access to the words returned by the function tokenizar, but
> what I get as result, for example for "a casa pegou fogo." is:
>
> Word #0 is 'a'
> Word #1 is 'casa'
> Word #2 is 'pegou'
> Word #3 is 'fogo'
>
> AND THEN A LOOP
>
> Word #0 is Word #0 is Word #0 is Word #0 is ...
>
> IN OTHER WORDS, I CAN'T HAVE ACCESS TO THE ARRAY OF WORDS CREATED INSIDE
> 'tokenizar'.
>
> What am I doing wrong?
>
> Thanks in advance!
>
> --
> Prof. Dr. Alexsandro Meireles, linguist
> Federal University of Espírito Santo
> Departamento de Línguas e Letras
> Av. Fernando Ferrari, 514. Campus Universitário
> Goiabeiras. 29075-910
> Vitória-ES. Brazil
> mei...@gm...
> +55-27-41021734
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
|