No it is a Big no in C you can do alot with string and also
manipluating string let me show you how to innitialize string it is
perfect but you have to bear in mind  in C you have to declare array
size before you can use string and also the data type should be char
this works perfectly good... let do some small innitializatin without
using the get and the put
char array_name [size];
char array_name
[6]= {'h','e','l','l','o','\0'} this is the code remember that in C in
string you have to state the NULL that is the \0 this terminate the
array string also let do a print out.
printf("%s",&array_name[0]);
but the short form for this is
printf("%s", array_name);
if
you want me to explain just tell me so i can explain but it is long to
explain that will take about multi lines. let me show you some muti
Line string this is the code
char array_name [60];
printf("%[^\n]s",array_name);
this is the array code hope this answer your question.. GudLuck Stay bless 
byeeeeeee.

Prince Annan Koomson

--- On Tue, 10/28/08, Andre Fecteau <[EMAIL PROTECTED]> wrote:
From: Andre Fecteau <[EMAIL PROTECTED]>
Subject: [c-prog] Newbie Newbie C question
To: "[email protected]" <[email protected]>
Date: Tuesday, October 28, 2008, 10:07 PM










    
            Hello Everyone,



I'm really new to c programming, so bear with my simple question.  I'm a

Perl programmer, who has just started learning C(not even experienced

at Perl).  I can get around and usually manage through lots of work to get

what I need done, done!  In Perl I can assign a string to an array element.



ex: $array[0] = "example";



In C it seems that you can only assign an individual letter to each element..



ex: array[0] = 'c';



Whenever I try to do what I do in Perl all the time, in c I get compile

errors.  What am I doing wrong?

Can I even do this in c?



If you can't do that in c, that's OK.  It's just really convenient to do it

the Perl way!



Thanks,

Andre



[Non-text portions of this message have been removed]




      

    
    
        
         
        
        








        


        
        


      

[Non-text portions of this message have been removed]

Reply via email to