simc fails to add reference address when input is not specified with data type
Chasmiccoder opened this issue · 1 comments
Chasmiccoder commented
Description of the Bug
According to the documentation, if the test.simc file contains an input line like this:
var a = input( )
Then, the type selected will be string. However, during compilation, the test.c file does not accept the input successfully.
To Reproduce the Bug
Steps to reproduce the behavior:
- In test.simc, write the line: var a = input( )
- Run the simc compiler to create test.c
- In test.c go over to the scanf( ) statement generated by the corresponding input( ) line of code.
- See error. After compilation, the compiler uses a as an argument to scanf( ) instead of using &a.
Expected behavior
The compiler should add an & symbol before the variable.
Screenshots
According to the Documentation:
After compilation (when .c file is created):
This is why the program crashes whenever input( ) is used without specifying the data type.
Desktop:
- OS: Windows 10, VS Code
frankhart2018 commented
Seems to be a duplicate of #183. Closing this.