돈의 크기에 따라
내가 얻을 수 있는 기회와 경험이
더크고 넓어질 수 있다.
꿈을 지켜 나가려면 돈이 필요하다.

'It's think(Thought become things)' 카테고리의 다른 글

2018년 늦은 시월  (0) 2018.10.30
오리  (0) 2017.09.21
간절함  (0) 2017.09.21
지금 무한반복중  (0) 2017.02.21
반복되는 현상  (0) 2017.02.20

" Linux 먼저 터미널..?

'It's IT > It's System(linux,win)' 카테고리의 다른 글

linux, unix shell script 조건문에서 사용하는 기호  (0) 2008.01.17
표준입력, 표준출력, 표준에러  (0) 2007.12.14
퍼미션, CHMODE  (0) 2007.12.14
VI명령어  (0) 2007.12.14
PING  (0) 2007.12.14


이렇게 또 한해가 가는구나

'It's think(Thought become things)' 카테고리의 다른 글

인정 하긴 실지만 사실이다. 꿈을 지켜 나가려면 돈이 필요 하다.......!!!!  (0) 2020.01.29
오리  (0) 2017.09.21
간절함  (0) 2017.09.21
지금 무한반복중  (0) 2017.02.21
반복되는 현상  (0) 2017.02.20

자주 쓰이는 말이 있어요.
핑계 대지 말라고!
너의 꿈을 이루고 싶은 '간절함'이 부족해서
못하는 거라는 말을 자주 듣곤 합니다.
하지만 이 간절함을 유지하면서 
살아갈 수 있는 사람은 많지 않다고 생각해요.

그렇다면 어떤 방법이 있을까요?
꿈을 이루고 싶은데 나의 간절함만으론 부족하다면
어쩔 수 없이 할 수 밖에 없는
주변 환경을 만들어보는 거에요.
영어회화를 잘하고 싶은데
국내에서 잘할 수 없다면
영어만을 사용할 수밖에 없는 곳으로 떠나는 것이죠.
간절함이 부족하면
간절할 수밖에 없는 무대 위에 나를 올려놓는 거에요.
벼랑 끝으로 스스로를 내몰아보세요.
어쩔 수 없이 할 수밖에 없을 테니까요.
이것도 하나의 좋은 방법이라고 생각해봅니다.

-어떤하루 중-

'It's think(Thought become things)' 카테고리의 다른 글

2018년 늦은 시월  (0) 2018.10.30
오리  (0) 2017.09.21
지금 무한반복중  (0) 2017.02.21
반복되는 현상  (0) 2017.02.20
개운하다  (2) 2010.07.31

역시나 오늘도 무한반복중

'It's think(Thought become things)' 카테고리의 다른 글

오리  (0) 2017.09.21
간절함  (0) 2017.09.21
반복되는 현상  (0) 2017.02.20
개운하다  (2) 2010.07.31
무엇이 최선인지  (0) 2010.07.29

생각을 해봐도 해결이 나지 않는다.

조급해진다. 지금 난 조급증만 더해간다. 

그저 시간만 이렇게 흘러 가고 그 시간을 또다시 후회 하고 있다.

이 상황이 계속 반복되고 있다.

'It's think(Thought become things)' 카테고리의 다른 글

간절함  (0) 2017.09.21
지금 무한반복중  (0) 2017.02.21
개운하다  (2) 2010.07.31
무엇이 최선인지  (0) 2010.07.29
시간이 .....  (0) 2010.07.29

Pointers and const

Pointing to const variables

So far, all of the pointers you’ve seen are non-const pointers to non-const values:

However, what happens if value is const?

The above snippet won’t compile -- we can’t set a non-const pointer to a const variable. This makes sense: a const variable is one whose value can not be changed. Hypothetically, if we could set a non-const pointer to a const value, then we would be able to dereference the non-const pointer and change the value. That would violate the intention of const.

Pointer to const value

A pointer to a const value is a (non-const) pointer that points to a constant value.

To declare a pointer to a const value, use the const keyword before the data type:

In the above example, ptr points to a const int.

So far, so good, right? Now consider the following example:

A pointer to a constant variable can point to a non-constant variable (such as variable value in the example above). Think of it this way: a pointer to a constant variable treats the variable as constant when it is accessed through the pointer, regardless of whether the variable was initially defined as const or not.

Thus, the following is okay:

But the following is not:

Because a pointer to a const value is not const itself (it just points to a const value), the pointer can be redirected to point at other values:

Const pointers

We can also make a pointer itself constant. A const pointer is a pointer whose value can not be changed after initialization

To declare a const pointer, use the const keyword between the asterisk and the pointer name:

Just like a normal const variable, a const pointer must be initialized to a value upon declaration. This means a const pointer will always point to the same address. In the above case, ptr will always point to the address of value (until ptr goes out of scope and is destroyed).

However, because the value being pointed to is still non-const, it is possible to change the value being pointed to via dereferencing the const pointer:

Const pointer to a const value

Finally, it is possible to declare a const pointer to a const value by using the const keyword both before the type and before the variable name:

A const pointer to a const value can not be set to point to another address, nor can the value it is pointing to be changed through the pointer.

Recapping

To summarize, you only need to remember 4 rules, and they are pretty logical:

  • A non-const pointer can be redirected to point to other addresses.
  • A const pointer always points to the same address, and this address can not be changed.
  • A pointer to a non-const value can change the value it is pointing to. These can not point to a const value.
  • A pointer to a const value treats the value as const (even if it is not), and thus can not change the value it is pointing to.

Keeping the declaration syntax straight can be challenging. Just remember that the type of value the pointer points to is always on the far left:

Conclusion

Pointers to const values are primarily used in function parameters (for example, when passing an array to a function) to help ensure the function doesn’t inadvertently change the passed in argument. We will discuss this further in the section on functions.


+ Recent posts