Skip to main content



      Home
Home » Newcomers » Newcomers » Character input(How do I input a character from the keyboard (stdin))
Character input [message #1799809] Fri, 14 December 2018 00:38 Go to next message
Eclipse UserFriend
I have been trying to input a character from the keyboard using the simple program shown below, with many different variations, but have had no luck.

The program and error is shown below:
/*
* main.c
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main ()
{
int c;

c = getchar(stdin);

asm ("sld %r1, c");
asm ("halt");
return 0;
}

When the function 'main' is compiled an errer like the one below occurs. Each time it compiles the file after "\\included\\scr\\ is
different even when it is included in the functions 'scr' file


Info: Internal Builder is used for build
"\\xgcc" -O0 -g3 -Wall -c -fmessage-length=0 -o "include\\src\\scanf.o" "..\\include\\src\\scanf.c"
Cannot run program "\xgcc": Launching failed

What am I doing wrong? Any help would be much appreciated.
Re: Character input [message #1799842 is a reply to message #1799809] Fri, 14 December 2018 10:29 Go to previous messageGo to next message
Eclipse UserFriend
It's best to ask on the CDT forum: https://www.eclipse.org/forums/eclipse.tools.cdt


It doesn't look like you've configured a toolchain properly. I.e., "\\xgcc" looks kind of bogus to me.
Re: Character input [message #1799849 is a reply to message #1799842] Fri, 14 December 2018 14:26 Go to previous message
Eclipse UserFriend
Looking at the embedded assembler code in the snippet, it seems that the poster is attempting a cross-compile, but hides the fact from us.

The code snippet does not make sense, even on bare hardware.
Previous Topic:two eclipse workspace use the same project
Next Topic:How can SpringLayout code be made immutable?
Goto Forum:
  


Current Time: Mon Jul 07 18:42:00 EDT 2025

Powered by FUDForum. Page generated in 0.09444 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top