Comments (6)
I am playing around with clang and wasm, using some c tutorial files and I cannot get scanf to work. Is this a limitation of the implementation? What am I missing? Here is the test file:
`#include <stdio.h>
int main () {
char str1[20], str2[30];
printf("Enter name: ");
scanf("%s", str1);
printf("Enter your website name: ");
scanf("%s", str2);
printf("Entered Name: %s\n", str1);
printf("Entered Website:%s", str2);
return(0);
}
~
~
"scantest.c" [New] 17L, 275C written
$ clang scantest.c
$ wasm a.out
Enter name: Enter your website name: Entered Name:
Entered Website:$ � `
from a-shell.
Yes, this is known limitation. For the time being, wasm listens to stdin if it is redirected, but not if it comes from the keyboard. So echo name website_name > wasm a.out
will work, but not what you tried. I'll keep that in mind as a possible use.
from a-shell.
from a-shell.
That will probably come with the ability to open files (also something really useful).
from a-shell.
Now that you’ve added the file capability, perhaps you can also add input from stdin?
from a-shell.
I'm trying...
from a-shell.
Related Issues (20)
- Working w/ git-crypt protected repositories HOT 2
- Self-compiled FFMPEG binary or updated bundled default native binary?? HOT 5
- Please make ~ point to the same place as cd HOT 1
- Cannot install ssh-copy-id HOT 2
- Adding PyArrow
- Request: which HOT 3
- Compiling WebAssembly Build HOT 2
- Flex and Bison HOT 4
- Cannot find 'webAssemblyCommandOrder' in scope HOT 1
- pbpaste in shell script HOT 1
- Displaying inline images HOT 1
- Error with submodule init: Fetched in submodule path 'cpython/packages/rasterio', but it did not contain fff416c6945b222f265fa268c4d56de34c8091dd. HOT 2
- iPad Air 5th Generation shows no special keyboard HOT 1
- wasm Error : JavaScript execution returned a result of an unsupported type HOT 4
- Add pyppeteer support
- Tmux or screen
- Bundle terminal fonts with a-shell itself? HOT 1
- Strings command HOT 4
- GPG HOT 6
- Set `XDG_STATE_HOME` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from a-shell.