Arrays are indexed from 0, so the loops should be for(i = 0; i<9; i++)
and not for(i = 1; i<10; i++)
In your case, you probably override part of the stack, but in general, going out of boundaries results in undefined behavior.
Related Posts:
- Meaning of Exit Code 11 in C?
- What is a segmentation fault?
- What causes a segmentation fault (core dump) to occur in C?
- What causes a SIGSEGV
- segmentation fault : 11
- segmentation fault : 11
- Segmentation Fault (core dumped) C++
- What is a bus error? Is it different from a segmentation fault?
- What is a bus error? Is it different from a segmentation fault?
- configure: error: cannot run C compiled programs
- Execution of printf() and Segmentation Fault
- segmentation fault using scanf
- Segmentation fault- strcat
- strtok segmentation fault
- segmentation fault with strcpy [duplicate]
- The difference between n++ and ++n at the end of a while loop? (ANSI C)
- How many spaces for tab character(\t)?
- Working on code to calculate cosine with factorial sum
- warning: implicit declaration of function
- What exactly is the difference between “pass by reference” in C and in C++?
- What does “collect2: error: ld returned 1 exit status” mean?
- Floating point exception (core dumped)
- Correct format specifier for double in printf
- Compiler Error “void value not ignored as it ought to be” in C programming [duplicate]
- Scanf/Printf double variable C
- How to convert a string to integer in C?
- What is the behavior of integer division?
- max value of integer
- Convert an int to ASCII character
- Awesomium sdk download
- Error “initializer element is not constant” when trying to initialize variable with const
- Cannot assign requested address – possible causes?
- need help understanding the movzbl call in this function
- How to extract C source code from .so file?
- What is the difference between read and pread in unix?
- What does “control reaches end of non-void function” mean?
- connect Error: “No route to host”
- C error: undefined reference to function, but it IS defined
- What is the printf format specifier for bool?
- warning: implicit declaration of function
- How to printf “unsigned long” in C?
- Why do I get an assertion failure?
- Difference between int32, int, int32_t, int8 and int8_t
- lvalue required as left operand of assignment
- how to convert negative hexadecimal to decimal
- Why am I getting “undefined reference to sqrt” error even though I inclu de math.h header?
- How to initialize a struct in accordance with C programming language standards
- Expression preceding parentheses?
- Linux equivalent of I_PUSH
- Understanding INADDR_ANY for socket programming
- expression must have integral type
- Why is %c used in C?
- What is Innermost loop in imperfectly nested loops?
- What’s wrong with my code? What is argv[1]?
- What can cause a “Resource temporarily unavailable” on sock send() command
- How to get the current directory in a C program?
- What’s the best way to check if a file exists in C?
- How to solve error: expected identifier or ‘(‘
- C compile : collect2: error: ld returned 1 exit status
- Split string with delimiters in C
- c array – warning: format not a string literal
- How to pause in C?
- I’m getting “Invalid Initializer”, what am I doing wrong?
- Warning/error “function declaration isn’t a prototype”
- Error: initializer element is not computable at load time
- %i or %d to print integer in C using printf()?
- How can I get the list of files in a directory using C or C++?
- How to prevent multiple definitions in C?
- How can you print multiple variables inside a string using printf?
- Multi-character constant warnings
- warning: passing argument ’from incompatible pointer type [enabled by default]’
- Return a `struct` from a function in C
- C dynamically growing array
- Why should we check WIFEXITED after wait in order to kill child processes in Linux system call?
- How to convert const char* to char* in C?
- Scanning Multiple inputs from one line using scanf
- C subscripted value is neither array nor pointer nor vector when assigning an array element value
- error: too few arguments to function `printDay’ (C language)
- Implementing a HashMap in C
- How to parse in C
- error: unknown type name ‘bool’
- Can I define a function inside a C structure?
- Trim a string in C [duplicate]
- Casting a pointer to an int
- How to repeat a char using printf?
- C Unknown type name ‘my_structure’
- Source file not compiled Dev C++
- PTHREAD_MUTEX_INITIALIZER vs pthread_mutex_init ( &mutex, param)
- How to concatenate string and int in C?
- execvp: bad address error
- How detect malloc failure?
- How to display hexadecimal numbers in C?
- error : storage class specified for parameter
- Dereference void pointer
- Use of flag in c?
- Reading float using scanf in c
- “-bash: gcc: command not found” using cygwin when compiling c?
- What do \t and \b do?
- write() to stdout and printf output not interleaved?
- Difference between “while” loop and “do while” loop