Hi, I am new to programming with C and I am trying to create something for the Nintendo DS. What I have now is very basic but even with the simple things like changing the color of a char array gives me a lot of problems. I now have the following:
helloworld.c
Code:
#include"helloworld.h"
void hello_world()
{
char text[] = "Hello World";
int i;
int textLength = strlen(text);
for (i = 0; i < textLength; i++)
{
/* Change the color of the letter here before printing it to the screen */
printf("%c", text[i]);
}
}
void loop()
{
while (true)
{
}
}
int main()
{
consoleDemoInit();
hello_world();
loop();
return 0;
}
helloworld.h
Code:
#ifndef HELLOWORLD_H_
#define HELLOWORLD_H_
#include<nds.h>
#include<stdio.h>
#define true 1
#define false 0
void hello_world();
void loop();
#endif
I tried a lot of things to change the color of each char but without success. Most of the times I get the error "Undefined reference to 'xxx'". The code that I have now works and compiles but how to change the text color? Sorry if this post is duplicated but all the solutions I found on this forum and other forums did not work for me. I am using Eclipse Indigo as my IDE on MacOSX Snow Leopard.
Any help would be greatly appreciated.