gcc « pointer « C Array Q&A

Home
C Array Q&A
1.bit
2.Byte
3.char
4.class
5.Development
6.Dimensional Array
7.dynamic
8.element
9.find
10.index
11.initialization
12.Integer
13.length
14.loop
15.memory
16.Operation
17.pointer
18.Print
19.size
20.Sort Search
21.string
22.struct
23.variable
C Array Q&A » pointer » gcc 

1. "Address of" (&) an array / address of being ignored be gcc?    stackoverflow.com

I am a teaching assistant of a introductory programming course, and some students made this type of error:

char name[20];
scanf("%s",&name);
which is not surprising as they are learning... What is surprising is that, ...

2. How would I make a pointer to an array of data work in C?    stackoverflow.com

I have four arrays of data (3072 bytes each.) I want to point to one of these arrays, so if a function were passed a pointer to these arrays, it could ...

3. how arrays are treated by gcc [ question related to C programing ]    stackoverflow.com

This compiles in gcc with no errors or warnings even with -Wall option meaning that array bounds are checked at run-time and hence compiler can't detect the error

#include<stdio.h>

int main()
{
    ...

4. Array Arithmetic Issue in C    stackoverflow.com

I have a C code in long file that is compiled using cc. But when I tried to compile on gcc it gives error. I took that particular code in small ...

5. Pointer to array and gcc warnings    bytes.com

Today I got a confusing message from gcc (I'm aware, those don't break conformance ;-) In function 'main': 7: warning: format '%d' expects type 'int', but argument 2 has type 'char (*)[1u]' The code is #include int main(void) { char p[3][2]; printf("%d\n", &p[0]); /* this is errornous, but it's on purpose there to generate the warning */ return 0; } ...

6. gcc: pointer to array    bytes.com

Alexei A. Frounze Hi all, I have a question regarding the gcc behavior (gcc version 3.3.4). On the following test program it emits a warning: #include int aInt2[6] = {0,1,2,4,9,16}; int aInt3[5] = {0,1,2,4,9}; void print1 (const int* p, size_t cnt) { while (cnt--) printf ("%d\n", *p++); } void print2 (const int (*p)[5]) { size_t cnt; #if 0 // prohibited: ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.