검색결과 리스트
분류 전체보기에 해당되는 글 107건
- 2012.03.04 Local IP 가져오는 C 소스
- 2012.02.15 2012 02 15 모르는 단어
- 2012.02.14 개발 중/상급 관련 책
- 2012.02.13 c++ 중급까지. .
- 2012.02.13 compile 할 때 시간 동기화 에러가 발생 하면..
- 2012.02.08 ssh 로그인 후 특정 위치로 바로 이동
- 2012.02.06 find 명령을 하위 디렉토리의 같은 파일 삭제 방법
- 2012.02.06 SSH login without password
- 2011.12.09 heap Memory Issue
- 2011.10.17 10.04에서 이클립스 및 cdt 설치 방법
글
OverFlow 커뮤니티를 보다가 정말 괜찮은 소스가 있길래 옮겨둔다
FILE * fp = popen("ifconfig", "r");
if (fp) {
char *p=NULL, *e; size_t n;
while ((getline(&p, &n, fp) > 0) && p) {
if (p = strstr(p, "inet addr:")) {
p+=10;
if (e = strchr(p, ' ')) {
*e='\0';
printf("%s\n", p);
break;
}
}
}
}
pclose(fp);
FILE * fp = popen("ifconfig", "r");
if (fp) {
char *p=NULL, *e; size_t n;
while ((getline(&p, &n, fp) > 0) && p) {
if (p = strstr(p, "inet addr:")) {
p+=10;
if (e = strchr(p, ' ')) {
*e='\0';
printf("%s\n", p);
break;
}
}
}
}
pclose(fp);
'Linux > C/C++' 카테고리의 다른 글
Configuration module to update in a file (0) | 2012.07.02 |
---|---|
Comparing floating point numbers (0) | 2012.06.18 |
va_start, va_arg, va_end (0) | 2012.06.08 |
printf, fprintf, sprintf, snprintf, asprintf, vprintf, vfprintf, vsprintf, vsnprintf, vasprintf – 서식으로 변환해 출력 (0) | 2012.06.08 |
heap Memory Issue (0) | 2011.12.09 |
설정
트랙백
댓글
글
dedicate
동사[vn]
1. ~ yourself/sth to sth/to doing sth (시간・노력을) 바치다, 전념[헌신]하다
She dedicates herself to her work.play
그녀는 자기 일에 전념하고 있다.
He dedicated his life to helping the poor.play
그는 가난한 사람들을 돕는 데 평생을 바쳤다.
2. ~ sth to sb (책・음악 작품・공연을) 헌정하다[바치다]
This book is dedicated to my parents.play
이 책을 저의 부모님께 바칩니다.
3. ~ sth (to sb/sth) (건물・기념물 등을) 봉헌하다
The chapel was dedicated in 1880.play
이 예배당은 1880년에 봉헌되었다.
A memorial stone was dedicated to those who were killed in the war.play
전몰자들을 위해 기념석이 봉헌되었다.
interaction
1. 상호 작용, 상호의 영향; [컴퓨터] 대화
2. (물리) 상호 작용
interact
동사[~ (with sb)]
1. (특히 작업 중에) 소통하다[교류하다]
Teachers have a limited amount of time to interact with each child.play
교사들이 아동 개개인과 소통할 수 있는 시간의 양은 제한되어 있다.
2. 상호 작용을 하다
Perfume interacts with the skin's natural chemicals.play
향수는 피부에 있는 천연 화학 물질과 상호 작용을 한다.
summarize
동사
요약하다
The results of the research are summarized at the end of the chapter.play
본 연구의 결과는 이 장 끝에 요약되어 있다.
awake
형용사
[명사 앞에는 안 씀] (아직) 잠들지 않은, 깨어 있는
to be half/fully awakeplay
잠이 반쯤/완전히 깨어 있다
to be wide awakeplay
완전히 깨어 있다
I was still awake when he came to bed.play
그가 침대로 왔을 때 난 아직 잠이 들지 않은 상태였다.
The noise was keeping everyone awake.play
그 소리 때문에 아무도 잠을 이루지 못하고 있었다.
I was finding it hard to stay awake.play
나는 (너무 졸려서) 깨어 있기가 힘든 지경이었다.
He lies awake at night worrying about his job.play
그는 밤이면 직장 걱정에 잠자리에 누워서도 잠을 못 이룬다.
She was awake during the operation on her leg.play
그녀는 다리에 수술을 받는 동안 의식이 깨어 있었다.
동사(awoke / ə'wəUk ; 美 ə'woUk / , awoken / ə'wəUkən ; 美 ə'woUkən /), (격식)
1. ~ (sb) (from/to sth) (잠에서) 깨다[깨우다]
I awoke from a deep sleep.play
나는 깊은 잠에서 깨어났다.
He awoke to find her gone.play
그가 잠에서 깨어 보니 그녀가 가고 없었다.
Her voice awoke the sleeping child.play
그녀의 목소리에 자고 있던 아이가 잠이 깼다.
2. (감정이) 일다; (감정을) 불러일으키다
His speech is bound to awake old fears and hostilities.play
그의 연설이 필시 해묵은 공포와 적대감을 불러일으킬 것이다.
theory
명사(pl. -ies)
1. [C , U] (어떤 현상을 설명하기 위한) 이론
According to the theory of relativity, nothing can travel faster than light.play
상대성 이론에 따르면 빛보다 더 빨리 이동할 수 있는 것은 없다.
2. [U] (특정 학문과 관련된) 학설[이론]
the theory and practice of language teachingplay
언어 교육의 이론과 실제
3. [C] ~ (that) (개인적인) 의견[생각]
I have this theory that most people prefer being at work to being at home.play
저는 대부분의 사람들이 집에 있는 것보다는 직장에 있는 것을 선호한다는 이런 생각을 갖고 있습니다.
theoretically
이론상
logical
형용사
1. 행동・사건 등이 타당한, 사리에 맞는
a logical thing to do in the circumstancesplay
그런 상황에서 할 수 있는 사리에 맞는 일
It was a logical conclusion from the child's point of view.play
그것이 그 아이의 관점에서 볼 때는 타당한 결론이었다.
2. 논리적인
a logical argumentplay
논리적인 주장
Computer programming needs someone with a logical mind.play
컴퓨터 프로그래밍에는 논리적인 사고를 지닌 사람이 필요하다.
usability
명사
[U] 유용성, 편리함
improve
동사
개선되다, 나아지다; 개선하다, 향상시키다
His quality of life has improved dramatically since the operation.play
수술 후에 그의 삶의 질이 극적으로 개선되었다.
The doctor says she should continue to improve.play
그녀가 계속 좋아질 것이라고 의사가 말한다.
to improve standardsplay
수준을 향상시키다
The company needs to improve performance in all these areas.play
회사는 이 모든 분야에서 실적을 개선할 필요가 있다.
I need to improve my French.play
나는 내 프랑스어 실력을 향상시켜야 한다.
combination
명사
1. [C] 조합[결합](물)
His treatment was a combination of surgery, radiation and drugs.play
그의 치료는 수술과 방사선 치료와 약물 치료가 결합된 것이었다.
What an unusual combination of flavours!play
정말 특이한 맛의 조합이군요!
Technology and good management. That's a winning combination.play
과학 기술과 훌륭한 경영. 그것이 성공을 위한 조합이다.
2. [U] 조합[연합] (행위)
The firm is working on a new product in combination with several overseas partners.play
그 회사는 몇몇 외국 제휴 업체들과 연합하여 신제품 작업을 하고 있다.
These paints can be used individually or in combination.play
이 페인트들은 개별적으로 사용할 수도 있고 조합해서 사용할 수도 있다.
3. [C] (부호 자물쇠 등을 열 수 있도록 숫자나 글자를 조합한 일련의) 부호[번호]
I can't remember the combination.play
자물쇠 번호가 기억이 안 나.
4. [pl.] combinations (英) 콤비네이션(예전에 입던 몸통과 다리 부분이 하나로 된 옛날 속옷)
distance
명사
1. [C , U] 거리 참고 long-distance, middle distance, outdistance
a short/long distanceplay
짧은/긴 거리
the distance of the earth from the sunplay
태양에서 지구까지의 거리
a distance of 200 kilometresplay
200킬로미터의 거리
What's the distance between New York City and Boston / from New York City to Boston?play
뉴욕 시와 보스턴 사이의/뉴욕 시에서 보스턴까지의 거리가 얼마인가요?
In the US, distance is measured in miles.play
미국에서는 거리를 마일로 측정한다.
The beach is within walking distance of my house.play
해변은 우리 집에서 걸어갈 수 있는 거리에 있다.
Paul has to drive very long distances as part of his job.play
폴은 직업상 아주 장거리를 운전해 다녀야 한다.
Our parents live some distance away.play
우리 부모님께서는 약간 멀리 떨어진 거리에 사신다.
2. [U] (공간상・시간상으로 떨어진) 거리
Distance is no problem on the Internet.play
인터넷에서는 거리가 문제가 안 된다.
3. [sing.] (특정한 거리를 사이에 둔) 먼 곳[지점]
You'll never get the ball in from that distance.play
그렇게 먼 곳[거리]에서는 절대 공을 받을 수 없을 것이다.
4. [C , U] [주로 단수로] (두 가지 사이의) 거리[차이]
The distance between fashion and art remains as great as ever.play
패션과 예술 사이의 거리는 그 어느 때나 마찬가지로 여전히 아주 크다.
The government is keen to put some distance between itself and these events.play
정부에서는 이런 사건들과 어느 정도 거리를 두려고[관련이 없음을 보여주려고] 애를 쓴다.
Eddie is, by some distance, the funniest character in the show.play
에디는 그 쇼에서 확연히 차이가 나게 가장 우스운 인물이다.
5. [U , C] (사람 사이의) 거리감
The coldness and distance in her voice took me by surprise.play
그녀의 목소리에 담긴 냉랭함과 거리감이 내게는 실로 뜻밖이었다.
동사
[타동사][VN] ~ yourself/sb/sth (from sb/sth) (~에) 관여[개입]하지 않다[않게 하다]
When he retired, he tried to distance himself from politics.play
그는 은퇴를 하고는 정치에 관여하지 않으려고 노력했다.
It's not always easy for nurses to distance themselves emotionally.play
간호사들이 감정적인 거리를 유지하기가 항상 쉽지는 않다.
동사[vn]
1. ~ yourself/sth to sth/to doing sth (시간・노력을) 바치다, 전념[헌신]하다
She dedicates herself to her work.play
그녀는 자기 일에 전념하고 있다.
He dedicated his life to helping the poor.play
그는 가난한 사람들을 돕는 데 평생을 바쳤다.
2. ~ sth to sb (책・음악 작품・공연을) 헌정하다[바치다]
This book is dedicated to my parents.play
이 책을 저의 부모님께 바칩니다.
3. ~ sth (to sb/sth) (건물・기념물 등을) 봉헌하다
The chapel was dedicated in 1880.play
이 예배당은 1880년에 봉헌되었다.
A memorial stone was dedicated to those who were killed in the war.play
전몰자들을 위해 기념석이 봉헌되었다.
interaction
1. 상호 작용, 상호의 영향; [컴퓨터] 대화
2. (물리) 상호 작용
interact
동사[~ (with sb)]
1. (특히 작업 중에) 소통하다[교류하다]
Teachers have a limited amount of time to interact with each child.play
교사들이 아동 개개인과 소통할 수 있는 시간의 양은 제한되어 있다.
2. 상호 작용을 하다
Perfume interacts with the skin's natural chemicals.play
향수는 피부에 있는 천연 화학 물질과 상호 작용을 한다.
summarize
동사
요약하다
The results of the research are summarized at the end of the chapter.play
본 연구의 결과는 이 장 끝에 요약되어 있다.
awake
형용사
[명사 앞에는 안 씀] (아직) 잠들지 않은, 깨어 있는
to be half/fully awakeplay
잠이 반쯤/완전히 깨어 있다
to be wide awakeplay
완전히 깨어 있다
I was still awake when he came to bed.play
그가 침대로 왔을 때 난 아직 잠이 들지 않은 상태였다.
The noise was keeping everyone awake.play
그 소리 때문에 아무도 잠을 이루지 못하고 있었다.
I was finding it hard to stay awake.play
나는 (너무 졸려서) 깨어 있기가 힘든 지경이었다.
He lies awake at night worrying about his job.play
그는 밤이면 직장 걱정에 잠자리에 누워서도 잠을 못 이룬다.
She was awake during the operation on her leg.play
그녀는 다리에 수술을 받는 동안 의식이 깨어 있었다.
동사(awoke / ə'wəUk ; 美 ə'woUk / , awoken / ə'wəUkən ; 美 ə'woUkən /), (격식)
1. ~ (sb) (from/to sth) (잠에서) 깨다[깨우다]
I awoke from a deep sleep.play
나는 깊은 잠에서 깨어났다.
He awoke to find her gone.play
그가 잠에서 깨어 보니 그녀가 가고 없었다.
Her voice awoke the sleeping child.play
그녀의 목소리에 자고 있던 아이가 잠이 깼다.
2. (감정이) 일다; (감정을) 불러일으키다
His speech is bound to awake old fears and hostilities.play
그의 연설이 필시 해묵은 공포와 적대감을 불러일으킬 것이다.
theory
명사(pl. -ies)
1. [C , U] (어떤 현상을 설명하기 위한) 이론
According to the theory of relativity, nothing can travel faster than light.play
상대성 이론에 따르면 빛보다 더 빨리 이동할 수 있는 것은 없다.
2. [U] (특정 학문과 관련된) 학설[이론]
the theory and practice of language teachingplay
언어 교육의 이론과 실제
3. [C] ~ (that) (개인적인) 의견[생각]
I have this theory that most people prefer being at work to being at home.play
저는 대부분의 사람들이 집에 있는 것보다는 직장에 있는 것을 선호한다는 이런 생각을 갖고 있습니다.
theoretically
이론상
logical
형용사
1. 행동・사건 등이 타당한, 사리에 맞는
a logical thing to do in the circumstancesplay
그런 상황에서 할 수 있는 사리에 맞는 일
It was a logical conclusion from the child's point of view.play
그것이 그 아이의 관점에서 볼 때는 타당한 결론이었다.
2. 논리적인
a logical argumentplay
논리적인 주장
Computer programming needs someone with a logical mind.play
컴퓨터 프로그래밍에는 논리적인 사고를 지닌 사람이 필요하다.
usability
명사
[U] 유용성, 편리함
improve
동사
개선되다, 나아지다; 개선하다, 향상시키다
His quality of life has improved dramatically since the operation.play
수술 후에 그의 삶의 질이 극적으로 개선되었다.
The doctor says she should continue to improve.play
그녀가 계속 좋아질 것이라고 의사가 말한다.
to improve standardsplay
수준을 향상시키다
The company needs to improve performance in all these areas.play
회사는 이 모든 분야에서 실적을 개선할 필요가 있다.
I need to improve my French.play
나는 내 프랑스어 실력을 향상시켜야 한다.
combination
명사
1. [C] 조합[결합](물)
His treatment was a combination of surgery, radiation and drugs.play
그의 치료는 수술과 방사선 치료와 약물 치료가 결합된 것이었다.
What an unusual combination of flavours!play
정말 특이한 맛의 조합이군요!
Technology and good management. That's a winning combination.play
과학 기술과 훌륭한 경영. 그것이 성공을 위한 조합이다.
2. [U] 조합[연합] (행위)
The firm is working on a new product in combination with several overseas partners.play
그 회사는 몇몇 외국 제휴 업체들과 연합하여 신제품 작업을 하고 있다.
These paints can be used individually or in combination.play
이 페인트들은 개별적으로 사용할 수도 있고 조합해서 사용할 수도 있다.
3. [C] (부호 자물쇠 등을 열 수 있도록 숫자나 글자를 조합한 일련의) 부호[번호]
I can't remember the combination.play
자물쇠 번호가 기억이 안 나.
4. [pl.] combinations (英) 콤비네이션(예전에 입던 몸통과 다리 부분이 하나로 된 옛날 속옷)
distance
명사
1. [C , U] 거리 참고 long-distance, middle distance, outdistance
a short/long distanceplay
짧은/긴 거리
the distance of the earth from the sunplay
태양에서 지구까지의 거리
a distance of 200 kilometresplay
200킬로미터의 거리
What's the distance between New York City and Boston / from New York City to Boston?play
뉴욕 시와 보스턴 사이의/뉴욕 시에서 보스턴까지의 거리가 얼마인가요?
In the US, distance is measured in miles.play
미국에서는 거리를 마일로 측정한다.
The beach is within walking distance of my house.play
해변은 우리 집에서 걸어갈 수 있는 거리에 있다.
Paul has to drive very long distances as part of his job.play
폴은 직업상 아주 장거리를 운전해 다녀야 한다.
Our parents live some distance away.play
우리 부모님께서는 약간 멀리 떨어진 거리에 사신다.
2. [U] (공간상・시간상으로 떨어진) 거리
Distance is no problem on the Internet.play
인터넷에서는 거리가 문제가 안 된다.
3. [sing.] (특정한 거리를 사이에 둔) 먼 곳[지점]
You'll never get the ball in from that distance.play
그렇게 먼 곳[거리]에서는 절대 공을 받을 수 없을 것이다.
4. [C , U] [주로 단수로] (두 가지 사이의) 거리[차이]
The distance between fashion and art remains as great as ever.play
패션과 예술 사이의 거리는 그 어느 때나 마찬가지로 여전히 아주 크다.
The government is keen to put some distance between itself and these events.play
정부에서는 이런 사건들과 어느 정도 거리를 두려고[관련이 없음을 보여주려고] 애를 쓴다.
Eddie is, by some distance, the funniest character in the show.play
에디는 그 쇼에서 확연히 차이가 나게 가장 우스운 인물이다.
5. [U , C] (사람 사이의) 거리감
The coldness and distance in her voice took me by surprise.play
그녀의 목소리에 담긴 냉랭함과 거리감이 내게는 실로 뜻밖이었다.
동사
[타동사][VN] ~ yourself/sb/sth (from sb/sth) (~에) 관여[개입]하지 않다[않게 하다]
When he retired, he tried to distance himself from politics.play
그는 은퇴를 하고는 정치에 관여하지 않으려고 노력했다.
It's not always easy for nurses to distance themselves emotionally.play
간호사들이 감정적인 거리를 유지하기가 항상 쉽지는 않다.
설정
트랙백
댓글
글
c/c++
http://winapi.co.kr/link/cppbook.htm
http://haew0n.tistory.com/15
http://kldp.org/node/31352
http://asllan-book.blogspot.com/2009/07/c-c-stl-win32-api-mfc.html
http://www.hanb.co.kr/exam/1583/
http://blog.naver.com/PostView.nhn?blogId=letsbemax&logNo=120120480507&categoryNo=28&parentCategoryNo=0&viewDate=¤tPage=9&postListTopCurrentPage=1
http://kldp.org/node/27330
http://winapi.co.kr/clec/cpp2/cpp2.htm
http://kkamagui.springnote.com/pages/643202
어셈 관련
http://www.drpaulcarter.com/pcasm/
http://homepage.mac.com/randyhyde/webster.cs.ucr.edu/index.html
http://www.ousob.com/ng/asm/ng47c.php
http://win32assembly.online.fr/tutorials.html
http://oopweb.com/Assembly/Documents/ArtOfAssembly/Volume/toc.html
http://faydoc.tripod.com/cpu/index.htm
http://winapi.co.kr/link/cppbook.htm
http://haew0n.tistory.com/15
http://kldp.org/node/31352
http://asllan-book.blogspot.com/2009/07/c-c-stl-win32-api-mfc.html
http://www.hanb.co.kr/exam/1583/
http://blog.naver.com/PostView.nhn?blogId=letsbemax&logNo=120120480507&categoryNo=28&parentCategoryNo=0&viewDate=¤tPage=9&postListTopCurrentPage=1
http://kldp.org/node/27330
http://winapi.co.kr/clec/cpp2/cpp2.htm
http://kkamagui.springnote.com/pages/643202
어셈 관련
http://www.drpaulcarter.com/pcasm/
http://homepage.mac.com/randyhyde/webster.cs.ucr.edu/index.html
http://www.ousob.com/ng/asm/ng47c.php
http://win32assembly.online.fr/tutorials.html
http://oopweb.com/Assembly/Documents/ArtOfAssembly/Volume/toc.html
http://faydoc.tripod.com/cpu/index.htm
'Reference > book' 카테고리의 다른 글
이력서 (0) | 2012.08.26 |
---|---|
c++ 중급까지. . (0) | 2012.02.13 |
C++ / STL 가이드북 (0) | 2011.04.04 |
설정
트랙백
댓글
글
http://kldp.org/node/31352
'Reference > book' 카테고리의 다른 글
이력서 (0) | 2012.08.26 |
---|---|
개발 중/상급 관련 책 (0) | 2012.02.14 |
C++ / STL 가이드북 (0) | 2011.04.04 |
설정
트랙백
댓글
글
간단하다.
touch ./*
위와 같이 치자.
touch ./*
위와 같이 치자.
'Script > Set enviroment' 카테고리의 다른 글
SSH login without password (0) | 2012.02.06 |
---|
설정
트랙백
댓글
글
ssh root@192.168.10.116 -t "cd /home/bluebamus/test; bash --login"
ssh root@192.168.10.161 -t "cd /home/bluebamus/105_error/test; bash --login"
ssh root@192.168.10.161 -t "cd /home/bluebamus/105_error/test; bash --login"
'Linux > Open tools' 카테고리의 다른 글
nslookup 명령어 사용예 (0) | 2012.05.31 |
---|---|
nslookup 사용법 (0) | 2012.05.31 |
netstat 사용법 정리 (0) | 2012.05.31 |
find 명령을 하위 디렉토리의 같은 파일 삭제 방법 (0) | 2012.02.06 |
10.04에서 이클립스 및 cdt 설치 방법 (0) | 2011.10.17 |
설정
트랙백
댓글
글
find . -name zoolog.txt -exec rm -rf {} \;
'Linux > Open tools' 카테고리의 다른 글
nslookup 명령어 사용예 (0) | 2012.05.31 |
---|---|
nslookup 사용법 (0) | 2012.05.31 |
netstat 사용법 정리 (0) | 2012.05.31 |
ssh 로그인 후 특정 위치로 바로 이동 (0) | 2012.02.08 |
10.04에서 이클립스 및 cdt 설치 방법 (0) | 2011.10.17 |
설정
트랙백
댓글
글
SSH login without password
--------------------------
Step 1) ssh-keygen -t rsa
Step 2) ssh root@192.168.0.150 mkdir -p .ssh
Step 3) cat .ssh/id_rsa.pub | ssh root@192.168.0.150 'cat >> .ssh/authorized_keys'
--------------------------
Step 1) ssh-keygen -t rsa
Step 2) ssh root@192.168.0.
Step 3) cat .ssh/id_rsa.pub | ssh root@192.168.0.
'Script > Set enviroment' 카테고리의 다른 글
compile 할 때 시간 동기화 에러가 발생 하면.. (0) | 2012.02.13 |
---|
설정
트랙백
댓글
글
어제 작업을 하면서 발견한 이슈를 기록하고자 한다
main
(
int * index;
indexClone(index);
if(index==NULL) printf("Fuck!!!! What's this!!!\n");
}
indexClone(*index)
{
index=(int *)malloc(MAXSIZE*sizeof(int);
}
위와같은 간단한 코드상에서 3가지 방법을 사용하여
main에서 결과값을 확인하였을떄
NULL이 잡힌다 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ
방법은 다음과 같다
1. 위와 같은 방법
2. 2차 포인트 사용
3. return을 힙메모리 주소로 던져주고 main의 index로 주소를 받는 방법
이론상으론 다 되어야 한다
안된다.
그래서 마지막으로 사용해 본 방법은 Struct를 사용해 1번 방법대로 만들었다.
된다.
거지같다 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ
아무리 생각하고 구글링해도 원인을 모르겠다
뭘까....
문제 해결 -------------- 이중포인터 사용 (내가 잘못 쓴듯)
#include <stdio.h>
#include <stdlib.h>
#define MAXSIZE 10
void indexClone(int **index)
{
*index=(int *)malloc(MAXSIZE*sizeof(int));
}
void main(void)
{
int *index;
while(1)
{
usleep(10000);
indexClone(&index);
if(index==NULL)
{
printf("Fuck you!!\n");
free(index);
}
else
{
printf("Ohhhh good!!\n");
free(index);
}
}
이중 포인터로 위와같은 방법을 쓰면 해결 가능
main
(
int * index;
indexClone(index);
if(index==NULL) printf("Fuck!!!! What's this!!!\n");
}
indexClone(*index)
{
index=(int *)malloc(MAXSIZE*sizeof(int);
}
위와같은 간단한 코드상에서 3가지 방법을 사용하여
main에서 결과값을 확인하였을떄
NULL이 잡힌다 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ
방법은 다음과 같다
1. 위와 같은 방법
2. 2차 포인트 사용
3. return을 힙메모리 주소로 던져주고 main의 index로 주소를 받는 방법
이론상으론 다 되어야 한다
안된다.
그래서 마지막으로 사용해 본 방법은 Struct를 사용해 1번 방법대로 만들었다.
된다.
거지같다 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ
아무리 생각하고 구글링해도 원인을 모르겠다
뭘까....
문제 해결 -------------- 이중포인터 사용 (내가 잘못 쓴듯)
#include <stdio.h>
#include <stdlib.h>
#define MAXSIZE 10
void indexClone(int **index)
{
*index=(int *)malloc(MAXSIZE*sizeof(int));
}
void main(void)
{
int *index;
while(1)
{
usleep(10000);
indexClone(&index);
if(index==NULL)
{
printf("Fuck you!!\n");
free(index);
}
else
{
printf("Ohhhh good!!\n");
free(index);
}
}
이중 포인터로 위와같은 방법을 쓰면 해결 가능
'Linux > C/C++' 카테고리의 다른 글
Configuration module to update in a file (0) | 2012.07.02 |
---|---|
Comparing floating point numbers (0) | 2012.06.18 |
va_start, va_arg, va_end (0) | 2012.06.08 |
printf, fprintf, sprintf, snprintf, asprintf, vprintf, vfprintf, vsprintf, vsnprintf, vasprintf – 서식으로 변환해 출력 (0) | 2012.06.08 |
Local IP 가져오는 C 소스 (0) | 2012.03.04 |
설정
트랙백
댓글
글
$ sudo apt-get update
$ sudo apt-get install build-essentail
$ sudo apt-get install sun-java6-jdk
$ sudo apt-get install eclipse
프로그램 > 개발 > 이클립스
HELP > Install New Software
ADD 클릭 후 다음 입력
이상이다.
프로그램 > 개발 > 이클립스
HELP > Install New Software
ADD 클릭 후 다음 입력
Galileo
이상이다.
'Linux > Open tools' 카테고리의 다른 글
nslookup 명령어 사용예 (0) | 2012.05.31 |
---|---|
nslookup 사용법 (0) | 2012.05.31 |
netstat 사용법 정리 (0) | 2012.05.31 |
ssh 로그인 후 특정 위치로 바로 이동 (0) | 2012.02.08 |
find 명령을 하위 디렉토리의 같은 파일 삭제 방법 (0) | 2012.02.06 |
RECENT COMMENT