support bazel complie this project and format code.
This commit is contained in:
9
basic_content/const/funciton_const/condition3/BUILD
Normal file
9
basic_content/const/funciton_const/condition3/BUILD
Normal file
@@ -0,0 +1,9 @@
|
||||
# please run `bazel run basic_content/const/funciton_const/condition3:condition1`
|
||||
load("@rules_cc//cc:defs.bzl", "cc_binary")
|
||||
|
||||
# Don't panic if you get compilation errors, this is what this code demonstrates, as expected.
|
||||
cc_binary(
|
||||
name = "condition1",
|
||||
srcs = ["condition1.cpp"],
|
||||
copts = ["-std=c++11"]
|
||||
)
|
Binary file not shown.
@@ -1,10 +1,8 @@
|
||||
#include<iostream>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main(){
|
||||
|
||||
const int p = 3;
|
||||
const int * const ptr = &p;
|
||||
cout<<*ptr<<endl;
|
||||
|
||||
int main() {
|
||||
const int p = 3;
|
||||
const int *const ptr = &p;
|
||||
cout << *ptr << endl;
|
||||
}
|
||||
|
Reference in New Issue
Block a user