Al codificar en C o C++, ¿dónde debería tener el #include
?#include in .h o .c/.cpp?
CallBack.h:
#ifndef _CALLBACK_H_
#define _CALLBACK_H_
#include <sndfile.h>
#include "main.h"
void on_button_apply_clicked(GtkButton* button, struct user_data_s* data);
void on_button_cancel_clicked(GtkButton* button, struct user_data_s* data);
#endif
callback.c:
#include <stdlib.h>
#include <math.h>
#include "config.h"
#include "callback.h"
#include "play.h"
void on_button_apply_clicked(GtkButton* button, struct user_data_s* data) {
gint page;
page = gtk_notebook_get_current_page(GTK_NOTEBOOK(data->notebook));
...
caso incluye a todos estar en cualquiera de los .h o .c/.cpp, o ambos, como he hecho aquí?
Déjeme cambiar esto y preguntar: ¿cuál fue su criterio para decidir poner sndfile.hy main.h en callback.h? –