-
outputting picture
ok here is a simple question....
i have a program that asks for the year you are born if you were born bc or ad... now if someone is born the same year as i am i output you are blah blah we are the same age....i would like that when a person enter the info a picture pops up is there a way to do that?:p :confused: :D
-
are you doing windows programming or console programming? Or 16 bit dos programming? What operating system? What compiler? Can we see any of your code... like the section where you want the pop-up to occur?
Short answer... yes you can. You can probably do it with a message box... but it depends what you are doing and how advanced you are getting with it.
-
Easiest way to do it would be using a dialog box..
-
its a dos program
i am using visual c++ 6.0
this is the code
#include <iostream.h>
#include <string>
int main ()
{
int year;
cout << "Enter the year you were born:";
cin >> year;
int factor;
factor = 2001;
int age;
age = factor - year;
int bc;
bc = factor + year;
char christ = NULL;
{
cout << "Enter if you were you born before or after christ...\npress [b] for before [a] for after then press enter : " ;
cin >> christ;
}
if (christ == 'b' || christ == 'B')
{
cout << " You are " << bc<<" years old";
}
else if (christ == 'a' || christ == 'A')
{
cout << " You are " << age <<" years old";
}
if (bc > 27 && christ == 'b' || christ == 'B')
{
cout << " you are "<< bc - 27 <<" Years older than me... "; //would like a picture pop up here.
}
else if (age > 27 && christ == 'a' || christ == 'A')
{
cout << " you are "<< age - 27 <<" Years older than me... "; //would like a picture pop up here.
}
else if (age < 27)
{
cout << " You are " << 27 - age <<" Years younger than me..."; //would like a picture pop up here.
}
else
{
cout << " We are the same age"; //would like a picture pop up here.
}
return 0;
}
-
-
>its a dos program
>i am using visual c++ 6.0
Then it's not a DOS program. It's a console program.
The console is the window that looks like DOS.
As a short, simple answer: no, there is no way.
You could write a real DOS program and display graphics there.
Or you could write a normal windows program and display
the graphics there. I wouldn't try graphics in a real DOS
environment, it's way outdated. I wouldn't try windows GUI
programming, it's far to difficult just yet. Just go on programming
and learning. Graphics in C/C++ are not easy.
-
graphic are not easy at all :( but i will continue learning and then one day i will be able to program final fantasy 20 <--- being realistic :D ...
so how do i start working with opengl and other things like that?
-
OpenGL is what I am currently learning. The best web site to learn is http://nehe.gamedev.net/ The site also has a forum board for questions.
With openGL, graphics are very easy to use once you have learnt it (like every other language on this planet), but I make a lot more errors programming in openGL than I do with normal C++ code. OpenGL is a lot more trial and error.
Games made in openGL include (and I may be wrong here) -> Rollercoaster tycoon & theme park world
Bottom line -> openGL is great
-