In reply to cgales:
In reply to Dev_Engine:
Your use of strings is incorrect.
The function $fgetc() doesn’t return a string, it returns an integer type. You should get an incompatible assignment error when trying to assign the return of $fgetc() to a string type.
You likely want to use ‘int’ instead of ‘string’ throughout your code.
I did replace ‘int’ wherever ‘string’ was but it gives an error that ‘cannot convert ‘unsigned int’ to ‘const std::__cxx11::basic_string&’
However with ‘string’ I read the file just fine but am stuck in the problem in OP.
P.S Is there any way to convert this string queue into a single string? I tried this in an always_latch:
foreach(arr[index])
begin
i=2*index;
j=i+1;
if(j<=arr.size)
str_arr={str_arr,arr[i],arr[j]}; //Concatenation
else
break;
end
But this broke down too with a warning: ‘Signal unoptimizable: Feedback to clock or circular logic’