You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Save this code in source.c:
void printArray(void) {
#define SIZE 10
int array[SIZE] = {5, 4, 3, 9, 1, 8, 6, 7, 5, 2};
printf("4: %d\n", array[4]);
}
printArray();
2. Run picoc -s source.c
What is the expected output? What do you see instead?
Expected: 4: 1
What I see: segmentation fault
What version of the product are you using? On what operating system?
r603 on Windows 7, compile with MS Visual Studio
Please provide any additional information below.
The following code will work:
#define SIZE 10
void printArray(void) {
int array[SIZE] = {5, 4, 3, 9, 1, 8, 6, 7, 5, 2};
printf("4: %d\n", array[4]);
}
printArray();
Original issue reported on code.google.com by [email protected] on 28 Feb 2014 at 2:06
The text was updated successfully, but these errors were encountered:
I've also seen this under OS X (and since my other reports generally say I've
duplicated a problem under Linux, I'll add that my lack of saying that doesn't
mean it works under Linux, just that I haven't tried).
Original issue reported on code.google.com by
[email protected]
on 28 Feb 2014 at 2:06The text was updated successfully, but these errors were encountered: