low-level question
- From: "jesso" <jesso1607@xxxxxxxxxx>
- Date: 30 Aug 2005 05:30:18 -0700
I couldn't get this on a midterm. Darn!
Anyone want to help?
1. Why does the following program output a 0?
2. Explain in detail.
3. How could you prevent this outcome without changing the code?
#include <stdio.h>
#include <string.h>
int
main( int argc, char *argv[] )
{
int ii = 1;
char buf[ 4 ];
strcpy( buf, "AAAA" );
printf( "%d\n", ii );
return 0;
}
.
- Follow-Ups:
- Re: low-level question
- From: Peter "Shaggy" Haywood
- Re: low-level question
- From: Bryan Donlan
- Re: low-level question
- From: tedu
- Re: low-level question
- From: Martin Ambuhl
- Re: low-level question
- From: Gordon Burditt
- Re: low-level question
- From: Robert Gamble
- Re: low-level question
- From: Zara
- Re: low-level question
- From: Lew Pitcher
- Re: low-level question
- Prev by Date: Re: while (1) vs. for ( ;; )
- Next by Date: understanding format specifiers
- Previous by thread: Function pointer prototype interpretation
- Next by thread: Re: low-level question
- Index(es):
Relevant Pages
|