I need to use Verilog to store each character from input file into an array.
I'm able to use $fgets to read each line, but I'm not sure how to break it down to each character.
Input file:
foo
bar
joe
stack
main:
c = $fgetc(infile);
while(c != `EOF) begin
r = ungetc(c,infile);
$fgets(str,infile);
c = $fgetc(infile);
$display (%0s,str);
end
I want to store it into str so that [0]str[0] = f and so on.