Coder Social home page Coder Social logo

Clang and wasm about a-shell HOT 6 OPEN

ifuchs avatar ifuchs commented on May 30, 2024
Clang and wasm

from a-shell.

Comments (6)

ifuchs avatar ifuchs commented on May 30, 2024

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.

holzschu avatar holzschu commented on May 30, 2024

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.

ifuchs avatar ifuchs commented on May 30, 2024

from a-shell.

holzschu avatar holzschu commented on May 30, 2024

That will probably come with the ability to open files (also something really useful).

from a-shell.

ifuchs avatar ifuchs commented on May 30, 2024

Now that you’ve added the file capability, perhaps you can also add input from stdin?

from a-shell.

holzschu avatar holzschu commented on May 30, 2024

I'm trying...

from a-shell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.