hi, i have a program source code, but i added some function. and now there are three the same errors, "illegal pointer conversion" how to correct them? compiler mikroc
I think this will compare the string Kodas starting with position k & string kort_duom starting with it's first character to the same number of characters Kodas[k] has (from position k to end of Kodas)
For example, if Kodas="abcdefgh" & kort_duom="qwertyuiop", and if k=2, then strcmp(&Kodas[k], kort_duom) will compare "cdefgh" with "qwerty".
Is it that you want?
My only concern is that Kodas will produce a ROM pointer and kort_duam a RAM pointer. I don't know MikroC well enought to be sure but I think strcmp expects 2 RAM pointers.
so i correct that error. The other problem is how to compare Kodas[] with code wich i receive from reader. if they match i sould get ok message in lcd, othewise error. compilator doesnt find any errors, but i doesnt work.
1 st problem: You are trying to compare a whole string with an int, using a strcomp. It won't work.
2 nd problem: Kodas has 4 strings with N size. So you have to use 2 different indexes, ok? Not Kodas[k][k] but Kodas[k][j], for example.
Wrong -> if (!strcmp(Kodas[k][k], kort_duom))
Try this one: if (atoi(Kodas[k][k])== kort_duom)
Don't forget the
#include <stdio.h>
#include <stdlib.h>