program problem

Non-platform specific questions.

program problem

Postby Caaz Games » Sun Mar 04, 2007 2:54 am

Code: Select all
 #include <stdio.h>

 

main(){

int x = 9;

int size;

size = sizeof(x);

printf(“The size of x is %d bytes.\n”, size);

}

when this program runs it's supposed to type the words "the size of x is 4 bytes.but it doesn't work, why is that?
You are welcome to join my forum. 4 active members lol but it's a cool place. active... much talking :D it's fun!
http://caaz.freeforums.org/
User avatar
Caaz Games
 
Posts: 729
Joined: Wed Feb 14, 2007 9:09 am
Location: California....knows how to party!
Score: 25 Give a positive score

Postby makslane » Sun Mar 04, 2007 1:32 pm

The include directive is not supported.
The printf function is not supported.

Use the sprintf function to put the text in a text actor, like this:

Code: Select all
int x1 = 9;
int size;
size = sizeof(x1);

sprintf(text,“"The size of x is %d bytes."”, size);
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Caaz Games » Sun Mar 04, 2007 4:19 pm

Oh, ok Thanks!
You are welcome to join my forum. 4 active members lol but it's a cool place. active... much talking :D it's fun!
http://caaz.freeforums.org/
User avatar
Caaz Games
 
Posts: 729
Joined: Wed Feb 14, 2007 9:09 am
Location: California....knows how to party!
Score: 25 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest