Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Clark Lin
StudyCpp
Commits
992778e3
Commit
992778e3
authored
Nov 06, 2022
by
Administrator
Browse files
add const
parent
61aaaab2
Changes
1
Hide whitespace changes
Inline
Side-by-side
01.Basic/Constant.cpp
0 → 100644
View file @
992778e3
#include <iostream>
using
namespace
std
;
#define LENGTH 10
#define WIDTH 5
#define NEWLINE '\n'
int
main
()
{
int
area
;
area
=
LENGTH
*
WIDTH
;
cout
<<
area
<<
" | defined by #define"
;
cout
<<
NEWLINE
;
// return 0;
const
int
CONS_LENGTH
=
7
;
const
int
CONS_WIDTH
=
8
;
const
char
CONS_NEWLINE
=
'\n'
;
// int area;
area
=
CONS_LENGTH
*
CONS_WIDTH
;
cout
<<
area
<<
" | defined by const"
;
cout
<<
NEWLINE
;
return
0
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment