//a.h
C/C++ code
#ifndef A_H
#define A_H
#include <stdio.h>
#include <string.h>
#define LEN (10)
struct Student
{
char *name;
int age;
};
void print_str(char *str)
{
printf("%s\n", str);
return ;
}
void print_int(int val);
#endif
//a.c
C/C++ code
#include "a.h"
void print_int(int val)
{
printf("value is : %d\n", val);
return ;
}
//main.c
C/C++ code
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "a.h"
int main()
{
char *str = "hello";
struct Student st1;
st1.name = "L";
st1.age = 18;
print_str(str);
print_str(st1.name);