या तो सी या सी ++ में कोडिंग करते समय, मुझे #include
कहां होना चाहिए?# .h या .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));
...
सभी या तो ज या ग/सीपीपी, या दोनों की तरह मैं यहाँ किया है में होना भी शामिल है चाहिए?
मुझे इसे चारों ओर चालू करने दें और पूछें: sndfile.h और main.h को कॉलबैक.h में डालने का निर्णय लेने के लिए _your_ मानदंड क्या था? –