I have an application in C. It already opens a text file and reads the entire line that the file has. It's a long line, for example: HTJxxxxxxxxxxxxxxxxxxxx ...
I can store this text file's contents in a variable.
But how do I read the first three characters only?
I need to read only the first three to create a condition that compares them with other values.
In Javascript it would look something like:
if(linha.substr(0, 2) === "HTJ")
{
// Condição
}
Thank you in advance!