how can i cast a char type array to an int type array
Answers were Sorted based on User's Feedback
Answer / moolshankershukla
int a[10];
char b[10];
a[10]=(char) b[10]; // type casting char type into int type.
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / harish
int b[10];char a[10];
for(int i=0;i<10;i++)
b[i]=(int)a[i];
| Is This Answer Correct ? | 1 Yes | 0 No |
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above
Cluster head selection in Wireless Sensor Network using C programming language.
Code for 1>"ascii to string" 2>"string to ascii"
1 Answers Aricent, Global Logic,
Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };
Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.
code of a program in c language that ask a number and print its decremented and incremented number.. sample output: input number : 3 321123
main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }
main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }
main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }
What is full form of PEPSI
main() { char not; not=!2; printf("%d",not); }