GCC Still generating error messages despite the synate is correct for the pointer declaration:
1 2 3 4 5 6 7 8 9 10
|
#include <iostream>
using namespace std;
int main()
{
int value = 12;
const int * [[no_unique_address]] volatile pointer = &value;
cout <<" Memory Address :" << pointer;
return 0;
}
| |
Error Message by GCC Compiler.
18:25:32 **** Build of configuration Debug for project LessionNo.3 ****
make all
Building file: ../Naive Bayes classifier.cpp
Invoking: GCC C++ Compiler
g++ -std=c++2a -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Naive Bayes classifier.d" -MT"Naive Bayes classifier.o" -o "Naive Bayes classifier.o" "../Naive Bayes classifier.cpp"
../Naive Bayes classifier.cpp: In function ‘int main()’:
../Naive Bayes classifier.cpp:16:42: error: expected unqualified-id before ‘volatile’
16 | const int * [[no_unique_address]] volatile pointer = &value;
| ^~~~~~~~
../Naive Bayes classifier.cpp:18:37: error: ‘pointer’ was not declared in this scope
18 | cout <<" Memory Address :" << pointer;
| ^~~~~~~
../Naive Bayes classifier.cpp:14:8: warning: unused variable ‘value’ [-Wunused-variable]
14 | int value = 12;
| ^~~~~
make: *** [subdir.mk:20: Naive Bayes classifier.o] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
18:25:33 Build Failed. 3 errors, 1 warnings. (took 476ms)