Coder Social home page Coder Social logo

Comments (2)

hermanzdosilovic avatar hermanzdosilovic commented on July 26, 2024

Hi @gouseferoz,

I can confirm that I can reproduce your issue.

But let's see what happens when we do this in a terminal locally.

  1. Create a file main.c with the following content:
#include <stdio.h>

int main(void) 
{
    printf("123\b45\n");
    return 0;
}
  1. Compile it:
gcc main.c
  1. Run it to get the expected results:
herman@zlata:test$ ./a.out 
1245
  1. Now redirect the output to a file out.txt to get again expected result after cut command.
herman@zlata:test$ ./a.out > out.txt
herman@zlata:test$ cat out.txt
1245
  1. But, let's see what is written inside the out.txt file:
herman@zlata:test$ vim out.txt

You will see a sequence that looks like this: 123^H45.

I.e. if you open it with gedit or some other editor you will see 123�45 as you noticed.

Also, if we take a look at what Judge0 API is returning as a stdout for a submission that contains above source code we can notice that the content of stdout is exactly what we see in the file out.txt.

Conclusion. Judge0 IDE does not work as a terminal that obviously knows how to work with the characters like \b. Judge0 IDE just shows you the content of a "file" that is the result of your submission.

I currently don't know how to make Judge0 IDE output pane behave as the terminal. Any suggestions are welcome.

from ide.

hermanzdosilovic avatar hermanzdosilovic commented on July 26, 2024

Closing due to inactivity.

from ide.

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.