Skip to content

Conversation

molecula451
Copy link
Contributor

@molecula451 molecula451 commented Dec 13, 2022

we can make this one clearer, usually we seen extern 'C' ... in header files, & avoid paraphrasing redundancy in "source code file"

we can may this one clearer, usually we seen <code> extern 'C' ... </code> in header files, & and avoid paraphrasing redundancy in "source code file"
@prmerger-automator
Copy link
Contributor

@molecula451 : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@opbld30
Copy link

opbld30 commented Dec 13, 2022

Learn Build status updates of commit 093a812:

✅ Validation status: passed

File Status Preview URL Details
docs/cpp/const-cpp.md ✅Succeeded

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

@Court72
Copy link
Contributor

Court72 commented Dec 13, 2022

@corob-msft

Can you review the proposed changes? IMPORTANT: When the changes are ready for publication, add a #sign-off comment to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@Court72 Court72 added aq-pr-triaged Tracking label for the PR review team and removed aq-pr-triaged Tracking label for the PR review team labels Dec 13, 2022
@colin-home
Copy link
Contributor

@molecula451

I appreciate the time and effort you've put into improving the documentation. Unfortunately, this change isn't appropriate here. It's true that you can declare an extern "C" variable in a header file, but you can't include that header in a C source file, since C doesn't know what extern "C" means. Similarly, you don't want to define an extern "C" variable in a header file (that is, initialize it), because that can lead to multiple definitions that will make the linker throw an error. The example in this article really is meant to be used in a C++ source file (the sort with a .cpp extension). So, I'm sorry your effort isn't being rewarded, but this PR shouldn't be merged.

@colin-home colin-home closed this Dec 13, 2022
@molecula451
Copy link
Contributor Author

molecula451 commented Dec 14, 2022

my bad, re-read the stuff, i thought i had read 2 times, "C++", thanks all good

@molecula451 molecula451 deleted the patch-1 branch December 14, 2022 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants