Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Identify the error in this code ?
Identify if I use the typedef statement like the one below , will it produce an error ?
Typedef char str
//And then using it to create a string ,
str fun[80] ;
Or
Typedef char str[80]
str fun ;
Which one is right ?
Should I mention the size of the string in the typedef statement or is ok if I do the way i did above ?
@roger that was a typing error , auto capitalization by apple. Thank you for your answers , i hope I get marks for it !
2 Answers
- rogerLv 77 years ago
neither is correct
Typedef is an error
typedef is correct
if you use typedef instead of Typedef then they both work...
#include <stdio.h>
#include <string.h>
typedef char str[80];
int main(void)
{
str fun ;
strcpy(fun,"testing");
printf("%s %d",fun,sizeof fun);
return 0;
}