Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 795

Unable to start the program visual studio 2022

$
0
0

Header file

#include <cstdio>class drink {public:    void step1();    virtual void step2() = 0;    void step3();    virtual void step4() = 0;};class coffee : public drink {public:    void step2();    void step4();};class tea : public drink {public:    void step2();    void step4();};

Class file

#include <stdio.h>class drink {public:    void step1() {        printf("boil water");    }    virtual void step2() = 0;    void step3() {            printf("Pour into the cup");    }    virtual void step4() = 0;};class coffee : public drink {public:    void step2() {        printf("Get coffee");    }    void step4() {        printf("Put sugar");    }};class tea : public drink {public:    void step2() {        printf("Get tea");    }    void step4() {        printf("put lemon");    }};

Main file

#include<stdio.h>#include "Header.h"int main() {    coffee coffeee;    coffeee.step1();    return 0;}

When I run the file it shows me unable to start the program, can't find the file. When I ignore the header file and put my class file and main file together, I can run the program. The way I create the file is just right clicking the project and choose Add, so I think my path is right. And I can also see all file in my project folder.

Does anyone know how to solve it? It confused me a lot. I don't know how to solve it


Viewing all articles
Browse latest Browse all 795

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>