LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Bus Error (core dumped) due to SIGBUS signal (https://www.linuxquestions.org/questions/linux-software-2/bus-error-core-dumped-due-to-sigbus-signal-340265/)

rajendra.badapanda 07-05-2005 12:05 PM

Bus Error (core dumped) due to SIGBUS signal
 
Hi,

Please note the behaviour of this program. I know that SIGBUS comes because of address mis-alignments in read/write acesses.

could anybody please explain the behaviour of the following program:

void main()
{
short a;

scanf("%d",&a);
printf("\n a= ",a);
}

case one:
chattan:~/junk]$ a.out
2 //input given
Bus Error (core dumped)
chattan:~/junk]$


case two:
chattan:~/junk]$ a.out
a //input given

a=
chattan:~/junk]$

MS3FGX 07-05-2005 12:10 PM

You would probably have better luck with this on the Programming board.


All times are GMT -5. The time now is 02:25 PM.