prinf isn't outputting anything (no errors)

heres my code

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <allegro.h>
#include <stdlib.h>
#include <stdafx.h>
#include <stdio.h>
int main (void) {
    allegro_init();
	printf("Allegro version = %s\n", allegro_id);
	system("pause");
    allegro_exit();
    return 0;
}
END_OF_MAIN()


The only output that I get is the "Press any key to continue..." default thing. I know I probably included way more headers than I needed to... But please someone help me. This is driving me insane.
What does allegro_init() do ?
Can you use the debugger? See what the value of variables are.

allegro_id is not being initialised properly - could be one of the things below - or something similar.

Have you named allegro_id correctly? Or referred to it properly? Was allegro_init done correctly?

I don't know anything about allegro - just offering some ideas that I would look into.

HTH
im not sure. I was told that it initializes allegro. This is just a sample code that I copied over to see if allegro was configured properly. the printf is supposed to output the version of allegro that i configured
I just found this:

http://www.loomsoft.net/resources/alltut/alltut_lesson1.htm


It talks about the main function being like this:

int main(int argc, char *argv[])

That could be enough to cause your problem possibly.
eh printf still isn't doing anything
I just found this:

http://www.loomsoft.net/resources/alltut/alltut_lesson1.htm


It talks about main like this:

1
2
int main(int argc, char *argv[])
{ 


You have:

int main (void) {

That might be enough to cause your problem.
Sorry about the double post - I thought I had lost the last one when my router went down.

http://www.allegro.cc/forums/thread/559706


1
2
3
4
5
6
7
8
9
10
11
12
#include <stdlib.h>
#include "allegro.h"

int main()
{

    allegro_init();
    allegro_message("Allegro version = %s\n", allegro_id);
    return 0;

}
END_OF_MAIN()


This snippet doesn't use printf.
okay thanks!
No worries, pleased to help out.

The only thing though - I don't know anything about allegro, but I managed to find a solution for you by doing a couple of Google searches - why couldn't you have done that?

However, all is forgiven if you don't have access to some sort of web searching program. This is the case for some people who live Iran for example.

Look forward to helping out in the future - Hope all is well at your end. :D
Topic archived. No new replies allowed.