ALT Linux Community general discussions
 help / color / mirror / Atom feed
* Re: [Comm] Как создать массив строк.
  2003-12-01 16:33 [Comm] Как создать массив строк some_x
@ 2003-12-01 10:36 ` Anikin Anton
  2003-12-01 17:03   ` some_x
  0 siblings, 1 reply; 6+ messages in thread
From: Anikin Anton @ 2003-12-01 10:36 UTC (permalink / raw)
  To: community

В сообщении от 2 Декабрь 2003 00:33 some_x написал(a):
> Народ подскажите плиз, как в C создать массив строк, чтоб потом элементы
> этого массива можно было выводить puts(или чем-нибуть ещё, кроме
> посимвольного вывода).
>     Заранее благодарен.
>
> _______________________________________________
> Community mailing list
> Community@altlinux.ru
> http://www.altlinux.ru/mailman/listinfo/community


char **array_of_strings;

попробуй...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Comm] Как создать массив строк.
  2003-12-01 17:03   ` some_x
@ 2003-12-01 11:20     ` Kylik Semuon
  2003-12-01 11:23     ` Maxim.Savrilov
  1 sibling, 0 replies; 6+ messages in thread
From: Kylik Semuon @ 2003-12-01 11:20 UTC (permalink / raw)
  To: community

В Пнд, 01.12.2003, в 19:03, some_x написал:
> Anikin Anton пишет:
> 
> >В сообщении от 2 Декабрь 2003 00:33 some_x написал(a):
> >  
> >
> >>Народ подскажите плиз, как в C создать массив строк, чтоб потом элементы
> >>этого массива можно было выводить puts(или чем-нибуть ещё, кроме
> >>посимвольного вывода).
> >>    Заранее благодарен.
> >>
> >>_______________________________________________
> >>Community mailing list
> >>Community@altlinux.ru
> >>http://www.altlinux.ru/mailman/listinfo/community
> >>    
> >>
> >
> >
> >char **array_of_strings;
> >
> >попробуй...
> >
> Программа:
> #include <stdio.h>
> #include <stdlib.h>
> 
> int main(int argc, char *argv[])
> {
>     char **a[]={"aa","bb"};

    char* a[]={"aa","bb"};

С уважением, Семен




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Comm] Как создать массив строк.
  2003-12-01 17:03   ` some_x
  2003-12-01 11:20     ` Kylik Semuon
@ 2003-12-01 11:23     ` Maxim.Savrilov
  2003-12-02 16:52       ` some_x
  1 sibling, 1 reply; 6+ messages in thread
From: Maxim.Savrilov @ 2003-12-01 11:23 UTC (permalink / raw)
  To: community

[-- Attachment #1: Type: text/plain, Size: 896 bytes --]

On Mon, 01 Dec 2003 17:03:01 +0000
some_x <some_x@inbox.ru> wrote:

> Anikin Anton пишет:
> 
> >В сообщении от 2 Декабрь 2003 00:33 some_x написал(a):
> >  
> >
> >>Народ подскажите плиз, как в C создать массив строк, чтоб потом элементы
> >>этого массива можно было выводить puts(или чем-нибуть ещё, кроме
> >>посимвольного вывода).
> >>    Заранее благодарен.
> >>
> >>_______________________________________________
> >>Community mailing list
> >>Community@altlinux.ru
> >>http://www.altlinux.ru/mailman/listinfo/community
> >>    
> >>
> >
> >
> >char **array_of_strings;
> >
> >попробуй...
> >
> Программа:
> #include <stdio.h>
> #include <stdlib.h>
> 
> int main(int argc, char *argv[])
> {
>     char **a[]={"aa","bb"};

    char *a[]={"aa","bb"};


-- 
No matter how subtle the wizard,
a knife in the shoulder blades will seriously cramp his style.

[-- Attachment #2: Type: application/pgp-signature, Size: 307 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Comm] Как создать массив строк.
@ 2003-12-01 16:33 some_x
  2003-12-01 10:36 ` Anikin Anton
  0 siblings, 1 reply; 6+ messages in thread
From: some_x @ 2003-12-01 16:33 UTC (permalink / raw)
  To: community

Народ подскажите плиз, как в C создать массив строк, чтоб потом элементы 
этого массива можно было выводить puts(или чем-нибуть ещё, кроме 
посимвольного вывода).
    Заранее благодарен.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Comm] Как создать массив строк.
  2003-12-01 10:36 ` Anikin Anton
@ 2003-12-01 17:03   ` some_x
  2003-12-01 11:20     ` Kylik Semuon
  2003-12-01 11:23     ` Maxim.Savrilov
  0 siblings, 2 replies; 6+ messages in thread
From: some_x @ 2003-12-01 17:03 UTC (permalink / raw)
  To: community

Anikin Anton пишет:

>В сообщении от 2 Декабрь 2003 00:33 some_x написал(a):
>  
>
>>Народ подскажите плиз, как в C создать массив строк, чтоб потом элементы
>>этого массива можно было выводить puts(или чем-нибуть ещё, кроме
>>посимвольного вывода).
>>    Заранее благодарен.
>>
>>_______________________________________________
>>Community mailing list
>>Community@altlinux.ru
>>http://www.altlinux.ru/mailman/listinfo/community
>>    
>>
>
>
>char **array_of_strings;
>
>попробуй...
>
Программа:
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    char **a[]={"aa","bb"};
    puts(a[0]);
  return EXIT_SUCCESS;
}
Результ:
main.cpp: In function `int main(int, char**)':
main.cpp:8: cannot convert `const char*' to `char**' in initialization
main.cpp:9: cannot convert `char**' to `const char*' for argument `1' to 
`int puts(const char*)'




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Comm] Как создать массив строк.
  2003-12-01 11:23     ` Maxim.Savrilov
@ 2003-12-02 16:52       ` some_x
  0 siblings, 0 replies; 6+ messages in thread
From: some_x @ 2003-12-02 16:52 UTC (permalink / raw)
  To: community

Maxim.Savrilov@socenter.ru пишет:

>On Mon, 01 Dec 2003 17:03:01 +0000
>some_x <some_x@inbox.ru> wrote:
>
>  
>
>>Anikin Anton пишет:
>>
>>    
>>
>>>В сообщении от 2 Декабрь 2003 00:33 some_x написал(a):
>>> 
>>>
>>>      
>>>
>>>>Народ подскажите плиз, как в C создать массив строк, чтоб потом элементы
>>>>этого массива можно было выводить puts(или чем-нибуть ещё, кроме
>>>>посимвольного вывода).
>>>>   Заранее благодарен.
>>>>
>>>>_______________________________________________
>>>>Community mailing list
>>>>Community@altlinux.ru
>>>>http://www.altlinux.ru/mailman/listinfo/community
>>>>   
>>>>
>>>>        
>>>>
>>>char **array_of_strings;
>>>
>>>попробуй...
>>>
>>>      
>>>
>>Программа:
>>#include <stdio.h>
>>#include <stdlib.h>
>>
>>int main(int argc, char *argv[])
>>{
>>    char **a[]={"aa","bb"};
>>    
>>
>
>    char *a[]={"aa","bb"};
>  
>
Точно :) Думать надо головой однако.

>  
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-12-02 16:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-01 16:33 [Comm] Как создать массив строк some_x
2003-12-01 10:36 ` Anikin Anton
2003-12-01 17:03   ` some_x
2003-12-01 11:20     ` Kylik Semuon
2003-12-01 11:23     ` Maxim.Savrilov
2003-12-02 16:52       ` some_x

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git