logo
Tags down

shadow

Erlang Printing N times


By : Ratih Novrianti
Date : October 17 2020, 08:10 AM
Hope that helps I am trying to teach myself some erlang and I keep getting an error that i do not understand. , try replacing
-export([repeat/1], [start/0]).
code :


Share : facebook icon twitter icon

printing a special character in Erlang


By : Doug Cote
Date : March 29 2020, 07:55 AM
wish of those help In Erlang single quote is used to denote an atom. So '#' becomes an atom instead of special character.
You might have to consider the value using $# which would represent a # character or "#" would represent a string (string is a list of characters in Erlang).
code :
1> io:format("~c~n",[$#]).
#
ok
2> io:format("~s~n",["#"]).
#
ok

My erlang code not printing as expected


By : sreelakshman g
Date : March 29 2020, 07:55 AM
hop of those help? You should use , instead of ; after the fourth line and remove hi() -> like below:
code :
 -module(shubham).
 -export([call/0, hi/0, guy/0]).
 call() -> hi().
 hi() -> guy(),
 io:fwrite("This is hi \n").
 guy() -> io:fwrite("This is A guy\n").

Erlang printing lists


By : abhi.ghosh409
Date : March 29 2020, 07:55 AM
like below fixes the issue io:format/2 evaluates to (returns) the atom ok so when you call lists:sort(List) you will have an ok at the end of that list. You might want to have one function to create towers and another to print them, because those are two separate concerns.

memory leak when printing bunch of times to a file by calling the function multiple times


By : Chel Marceli De Leon
Date : March 29 2020, 07:55 AM
Hope that helps You need an fclose() at the bottom of your function (and you don't need the fflush()--the file will get flushed when it gets closed).
You also should be checking for (pf == NULL) before referencing it, in case of an error on the fopen(). Getting an error message is far more useful than getting a SEGV.

Erlang printing hex instead of integer


By : R.SeolHui
Date : March 29 2020, 07:55 AM
To fix this issue The shell is going to try to print strings as strings whenever it would be legal. That means lists of integers that happen to all be valid characters will be printed as characters, and lists that contain other things will be printed as lists:
shadow
Privacy Policy - Terms - Contact Us © voile276.org