[Anjuta-list] Infinite Loop in Terminal program



Hi,
I am using the anjuta 1.0beta from the recently posted RPM on Redhat 7.2,
gnome-core-1.4.0.4-38, and gtk+-1.2.10-1. Below is code for a generic/terminal application that runs correctly when executed from a separate shell and also from the anjuta terminal (from the message frame tab). However, if I invoke anjuta from a shell as: "anjuta &", then build and execute it from the "Build" menu, it generates an infinite loop in the shell from which I invoked anjuta.

I use anjuta for teaching C to biologists, and it is a great help, but this bug/feature is a source of confusion that my students do not need.

Am I doing something wrong? Can I force "Execute" to go to the message frame terminal (where I actually would have expected it go), not the invoking shell?

THanks, and responding to me directly would be a help.

Jim Haefner

---------------------------------
/* sum.c -- create and print a running sum of numbers */
#include <stdio.h>          /* preprocessor info for printf() */

int main()
{
    /* declare the local variables we need */
	int done;              /* integer, flag to stop reading */
	
	done = 0;              /* make 'done' "false" (assignment) */

	/* begin loop to read and add numbers */
	while (done == 0) {    /* keep going until done not eq 0 */
		/* Are we done yet? */
		printf("If you've had enough, type 1, else type 0 (then ENTER): ");
		scanf("%d",&done);      /* this changes the value of 'done' */
	}
	
    return(0);      /* return from main() back to the operating system */
}


---------------------------------



James W. Haefner             Email: jhaefner biology usu edu
Dept Biology/Ecology Center  Voice: 435-797-3553
Utah State University        FAX:   435-797-1575
Logan, UT 84322-5305





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]