0

so im begining some project, and to try to check my work im trying to print out results as of point x to see whats going on. I just started and im already stuck, and I cant find any reason why I am getting an error.

Here im trying to create and array, all blank, then print out all the elements within the array.

#include <stdio.h>

int main()
{
	
	unsigned char imgSet[10] = {0} ;
	printf('%c', imgSet[] );
}
2
Contributors
3
Replies
5
Views
6 Years
Discussion Span
Last Post by jayzee1989
0

Try this and you'll display the first element in imgSet.

printf("%c", imgSet[0] );

Edited by gerard4143: n/a

0

nevermind this, I found the issue now after reading up on arrays for about an hour. The '%c' should have been a "%c".

Amazing how fast Daniweb has helped me XD

#include <stdio.h>

int main()
{

    unsigned char imgSet[10] = {0} ;
    printf('%c', imgSet[] );
}

Edited by mike_2000_17: Fixed formatting

0

Try this and you'll display the first element in imgSet.

printf('%c', imgSet[0] );

yeh, i was getting that, but seems to be an issue with the apostraphes instead of quotation marks. with 'c' I was getting some weird error messages for some reason.

ty though ^^

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.