Skip to content

Instantly share code, notes, and snippets.

@lix19937
Last active May 6, 2025 06:00
Show Gist options
  • Save lix19937/9c2463d51ed32708c4a039c6d5259ef3 to your computer and use it in GitHub Desktop.
Save lix19937/9c2463d51ed32708c4a039c6d5259ef3 to your computer and use it in GitHub Desktop.
macro_define.cpp
#include <iostream>
#include <numeric>
using namespace std;
#define DEFINE_H_D_PTR(name) void *name##_ptr, *name##_d_ptr
int main(){
int array[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
int sum = accumulate(array, array + std::size(array), 0);
cout << "array = " << sum << endl;
printf(">>>>> %d\n", sum);
DEFINE_H_D_PTR(kke);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment