make prog.bin
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
char first_name[50];
char last_name[50];
char full_name[100];
char *twelve = "12";
int main(int argc, char **argv)
{
printf("What is your first name?\n");
gets(first_name);
printf("Hello %s\n", first_name);
printf("Your name is %d characters long!\n", strlen(first_name));
printf("What is your last name?\n");
gets(last_name);
strcpy(full_name, first_name);
strcat(full_name, " ");
strcat(full_name, last_name);
printf("Hello again, %s\n", full_name);
printf("Here's 12: %d\n", atoi(twelve));
printf("Here's a random number: %d\n", rand());
return 0;
}
This looks great! Will test it over the weekend.
Mike
--
You received this message because you are subscribed to the Google Groups "MikeOS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mikeos+un...@googlegroups.com.
To post to this group, send email to mik...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mikeos/b95d23f8-f1c6-4c15-b179-fefb08e54968%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I used Windows explorer to copy the echo.bin and prog.bin to an actual 1.44MB FAT32 floppy diskwith mikeos-4.6b1_FAT32. I reset the PC which booted from the floppy and ran both programs
from the MikeOS file selector.
There is a small issue with prog.bin. After pressing return after entering the "last name" the program
abruptly exits.
On Saturday, May 28, 2016 at 1:06:45 AM UTC-4, ZeroKelvin Keyboard wrote:On Saturday, 28 May 2016 06:57:36 UTC+9:30, Mike Gonta wrote:I used Windows explorer to copy the echo.bin and prog.bin to an actual 1.44MB FAT32 floppy diskwith mikeos-4.6b1_FAT32. I reset the PC which booted from the floppy and ran both programs
from the MikeOS file selector.
There is a small issue with prog.bin. After pressing return after entering the "last name" the program
abruptly exits.
I have tested the program on the stock build of MikeOS 4.6b1 and it
works okay for me.
I believe you, however I think you might be using something different from what
you distributed.
What do you mean when you say "abruptly"? The program is meant to finish after
you enter your last name. Is it terminating immediately without printing out
anything?
When you hit the enter key after imputing the last name it immediately exits to the
file selector screen.
Unfortunately, I forget to check if anyone had done this already.
Thanks for bringing this to my attention. I really appreciate the help!