No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
[CODE] struct abc{ char a; char b; char c; }; [/CODE] what is sizeof (struct abc) in gcc ? it is giving 3, why not 4 bytes. |
|
[CODE] main() { char *p="dcis"; while(*p++!='\0'); printf("%s",p); } [/CODE] Why this is printing %s in my unix box with gcc 4.6.1 ? |
|
[CODE] swap (char *p, char *q) { printf ("%c\t%c\n", *p, *q); *p ^= *q ^= *p ^= *q; printf ("%c\t%c\n", *p, *q); } int main (int argc, char *argv[]) { if (argc < 2) { printf ("\nSyntax: ./a.out str\n\n"); exit (1); } char *p, *q, temp; p = q = … |
|
[code=c] #include <stdio.h> #include <string.h> #define MAX_input_size 100 struct RoutingInfo{ /* Structure to hold the IP entrys */ unsigned int IPDestinationNetwork; unsigned int subnetMask; int prefix; unsigned int gateway; char* interface; } entry[MAX_input_size]; int computePrefix (unsigned long decimSM){ /* computes the prefix of the Subnet Mask */ int prefix = … |