How to include stdio.h for printf?

New to XMOS and XCore? Get started here.
MosMax
New User
Posts: 3
Joined: Wed May 23, 2012 12:44 am

How to include stdio.h for printf?

Postby MosMax » Wed May 23, 2012 1:08 am

This should be an easy question to answer. I am extremely new to this. I tried compiling this code for the XC-1, but the compiler had the error can't open include file "stdio.h".

Thanks!

Code: Select all

# include < stdio .h >

main ( void ) {
   printf ( " Hello , world !\ n " );
}


Fixed it!. The problem was the spaces. It should be

Code: Select all

#include <stdio.h>
main ( void ) {
printf ("Hello , world !\n");
}
User avatar
phalt
Respected Member
Posts: 298
Joined: Thu May 12, 2011 11:14 am
Contact:

Postby phalt » Wed May 23, 2012 9:25 am

For a lot of these types of questions, especially common ones related to C, you can google the answers or check on stackoverflow
User avatar
rp181
Respected Member
Posts: 395
Joined: Tue May 18, 2010 12:25 am
Contact:

Postby rp181 » Thu May 31, 2012 1:16 am

Also, it should be noted almost all examples in the pdf documentation will not copy-paste correctly. It's easier to re-type the examples.

Return to “Getting started”

Who is online

Users browsing this forum: No registered users and 2 guests