Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Whats wrong with the following function

char *string()
{
char *text[20];
strcpy(text,"Hello world");
return text;
}

Answer Posted / vignesh1988i

as for as i know , there is only one error..... you have
declared text as array of pointers and not as character data
array..... so this text can only accept addresses.... :)

char *text[20] means you are going to store 20 addresses in
this array..... When you store addresses using arrays , the
that is called array of pointers....

if u declare : char text[20] , this will work correctly..



thank u

Is This Answer Correct ?    13 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does volatile do?

944


What is const and volatile in c?

995


What is the difference between fread and fwrite function?

1044


can any one provide me the notes of data structure for ignou cs-62 paper

2130


Explain what will the preprocessor do for a program?

1011


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

2785


What is the purpose of sprintf?

1075


What are reserved words with a programming language?

1068


What is zero based addressing?

1121


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

1020


Explain spaghetti programming?

1195


Explain the difference between null pointer and void pointer.

1040


Where in memory are my variables stored?

1123


how logic is used

1924


Why is c called a mid-level programming language?

1156