int a;
static int b;
main()
{
int c;
static int d;
}
typedef struct test {
int a;
char *str;
}TEST;
int main()
{
TEST *ptr = NULL;
char *name1 = "CHIRAGKUMAR";
char *name2 = "PANELIYA";
/* populate the ptr with values. Use name1 and name2 to fill *str.
Expected end result for str is "CHIRAGKUMARPANELIYA" */
/* After successful population, terminate the program gracefully */
[11:57 AM] deepak (Guest)
ptr = (TEST *) malloc(sizeof(TEST));
[11:57 AM] deepak (Guest)
ptr->a = 100;
[11:58 AM] deepak (Guest)
int i =0, j=0;
[11:59 AM] deepak (Guest)
while (name[i] = '\0')
[11:59 AM] deepak (Guest)
{
[12:02 PM] deepak (Guest)
ptr = (TEST *) malloc(sizeof(TEST));
ptr->a = 100;
ptr->str = strcat(name1, name2);
typedef struct test {
int a;
char *str;
}TEST;
int main()
{
TEST *ptr = NULL;
char *name1 = "CHIRAGKUMAR";
char *name2 = "PANELIYA";
/* populate the ptr with values. Use name1 and name2 to fill *str.
Expected end result for str is "CHIRAGKUMARPANELIYA" */
printf("enter the number\n");
scanf("%d",&ptr->a);
strcpy(ptr->str,name1);
strcat(ptr->str,name2);
printf("a=%d and str=%s\n",ptr->a,ptr->str);
/* After successful population, terminate the program gracefully */
free(ptr);
ptr=NULL;
return 0;
}