Last active
May 6, 2025 06:00
-
-
Save lix19937/9c2463d51ed32708c4a039c6d5259ef3 to your computer and use it in GitHub Desktop.
macro_define.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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