Can you give include in previous folder in c++?

Asked

Viewed 318 times

0

ex:gerenciadorDeArquivos

it is possible to include main.cpp in the header. h?

  • ???. You who include header.h but you have as available header1.h.

1 answer

2

Adding the value of the directive include in quotation marks, the file will be searched relative to the current directory. To include a header from a top/previous folder, you can use two dots:

#include "../header1.h"

If I understand your example:

#include "../headers/header1.h"
  • thanks, helped me with this doubt

  • Good :) If you consider the correct answer, please mark as answered.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.