- Code: Tout sélectionner
#include <stdio.h>
#include <stdlib.h>
#include <os.h>
int main()
{
int a;
printf("Enter a number: ");
scanf("%d",&a);
printf("you entered %d\n",a);
return 0;
}
- Code: Tout sélectionner
nspire-gcc -Wall -W -marm -Os -c practice.c -o practice.o
mkdir -p .
nspire-ld practice.o -o practice.elf -Wl,--nspireio
genzehn --input practice.elf --output practice.tns.zehn --name "practice"
make-prg practice.tns.zehn practice.tns
rm practice.tns.zehn
But when load the .tns file to my nspire I can't get it to run normally. The screen is black with no prompt unless I enter a number. But when I enter a number the program executes and then instantly terminates. How do you run programs with normal user I/O?