I can see multiple ways of doing this.
1) Make the console start the image file with the default image viewer by running an ms-dos command using the system() function. Horrible idea.
2) Make a program using a graphics library such as SDL or SFML which simply loads the picture. You can also make it show stuff in the console, or use a batch file to write to console and start this picture display. But since you're beginning C++, that's most likely out of the question.
3) Make a program which writes in colors inside the console using the windows API and read the picture pixel per pixel to draw it out of characters in the console. You'dd either need to look at image encoding and how gif or bmp works, or use a graphics library. And the image would look horrible, it's not what you want.
Since I've been of no help, let me teach you about files in c++ and how to use more than one.
The first file which is compiled is the one containing the main() function. The name of the file doesn't matter. People often call it main.cpp, while others prefer giving it the name of the program/project. When you write #include "file.h", the compiler reads all the content of file.h, then looks for file.cpp and if it exists, reads the the content of file.cpp before returning to the main file.
To avoid problems if a file gets included by multiple files, you should always surround your .h files with this
1 2 3 4 5 6 7
|
#pragma once
#ifndef NAME_OF_THE_FILE_H
#define NAME_OF_THE_FILE_H
// code goes here
#endif // NAME_OF_THE_FILE_H
|
and the cpp files should include only one h file
#include "file.h"
you could also enclose the .cpp content with what I gave for the .h file but replacing the H at the end with CPP. You can search online to figure out how it works, but basically it prevents a file from being included twice.