What is the better way to design variables?

Should i format variables like this: String type = null; String name = null; int age = 0; double weight = 0; boolean isFly; boolean isWalk; boolean isSwim; Or like this: String type = null, name = null; int age = 0; double weight = 0; boolean isFly, isWalk, isSwim; And may you give me… Read More What is the better way to design variables?

warning: format '%s' expects argument of type char problem in a simple program

#include<stdio.h> #include<stdlib.h> int main() { char str1[20]; printf("Name: "); scanf("%s",&str1); printf("Your name is %s",str1); return 0; } it outputs fine but the the build messages say warning: format ‘%s’ expects argument of type char ‘, but argument 2 has type ‘char () [20]’ [-Wformat=] >Solution : str1 has type "array of 20 char" (char[20]). &… Read More warning: format '%s' expects argument of type char problem in a simple program