C const char* -> string, hello world
그냥 웹에서 타자 작성
#include <unistd.h>
#define tem_con(T, name) \
typedef struct { \
T* d; unsigned long long int size; \
} name
tem_con(char, string);
#define create_string(c_str) \
(string){c_str, sizeof(c_str)}
#define _for_(T, val, arr) \
for(T* val = arr.d; val != (char*)arr.d + arr.size; val++)
int main(int argc, char** argv) {
string str = create_string("hello_world");
_for_(char, it, str ) {
write(1, it, 1);
}
return 0;
}
#include <unistd.h>
#define template_one_container(T, name) \
struct { \
T* d; \
unsigned long long int size; \
} name
#define template_container(T, name) \
typedef template_one_container(T, name)
template_container(char, std_string);
#define create_string(c_str) \
(std_string){ c_str, sizeof(c_str) }
#define create_array(format) \
{ format, sizeof(format) }
#define define_array(T, name, count) \
T __CA__##name[count]; \
template_one_container(T, name) = \
create_array(__CA__##name)
#define _for_(T, val, arr) \
for(T* val = arr.d; (char*)val != (char*)(arr.d) + arr.size; val++ )
int toString(int number, std_string str)
{
char* str_ptr = str.d+str.size;
char* write_ptr = str.d;
if(number == 0) {
str.d[0] = '0';
return 1;
} else if(number < 0) {
*(write_ptr++) = '-';
number = -number; // 최소값은 저는 모르는거에욧
}
while(--str_ptr != str.d -1 && number != 0)
*str_ptr = number % 10 + '0', number /= 10;
while(str_ptr != str.d+str.size)
*(write_ptr++) = *(str_ptr++);
*(write_ptr++) = '\0';
return (int)(write_ptr - str.d);
}
int main(int argc, char** argv)
{
std_string string = create_string("hello world\n");
define_array(int, intInArray, string.size);
char* str_ptr = string.d;
_for_(int, it, intInArray) {
if(str_ptr == string.d + string.size) break;
*it = *(str_ptr++);
}
char __buffer__[32] = {0};
std_string buffer = create_string(__buffer__);
_for_(int, it, intInArray) {
int size = toString(*it, buffer);
buffer.d[size++] = ' ';
write(1, buffer.d, size);
}
return 0;
}숫자 hello world
0
0 comments
일반
바이브 코딩이 개발능력 형성에 끼치는 영향
kimtaychon98
06/30
1583
2
바이브 코딩이 개발능력 형성에 끼치는 영향
일반
kimtaychon98
06/30 1583 2
일반
백준 대체싸이트 추천좀
hyeon111
05/23
1742
0
백준 대체싸이트 추천좀
일반
hyeon111
05/23 1742 0
일반
바이브코딩
라면올킬
05/02
1633
0
바이브코딩
일반
라면올킬
05/02 1633 0
일반
개발중인 사이트 있는데
hassan94
04/24
1558
1
개발중인 사이트 있는데
일반
hassan94
04/24 1558 1
PY
7JWM652865SYIOuzte2YuO2ZlA==
wef4r2
04/21
1718
2
7JWM652865SYIOuzte2YuO2ZlA==
PY
wef4r2
04/21 1718 2
일반
너무나도 조용한 서브...
이오치 마리
03/27
1563
0
너무나도 조용한 서브...
일반
이오치 마리
03/27 1563 0
일반
여기 좀 살려보면 안되나?
frzdk
02/15
1574
0
여기 좀 살려보면 안되나?
일반
frzdk
02/15 1574 0
일반
코딩 초보인데 이거 정상이지?
qqbbs
02/15
1706
1
코딩 초보인데 이거 정상이지?
일반
qqbbs
02/15 1706 1
일반
아카 크롤링하려면 얼마나 배워야해?
kang33
12/29/25
1774
0
아카 크롤링하려면 얼마나 배워야해?
일반
kang33
12/29/25 1774 0
JS
타입 스크립트는 적응이 안되네
ㅇㅇ
12/17/25
1390
0
타입 스크립트는 적응이 안되네
JS
ㅇㅇ
12/17/25 1390 0
일반
이사올랬는디 정전이네
gunsight
12/06/25
5627
0
이사올랬는디 정전이네
일반
gunsight
12/06/25 5627 0
일반
LLM이 정말로 위험한건 이거임
Rohthis_
12/05/25
2442
1
LLM이 정말로 위험한건 이거임
일반
Rohthis_
12/05/25 2442 1
PY
동적 변수 import 질문
보성녹차드링커
11/29/25
1476
1
동적 변수 import 질문
PY
보성녹차드링커
11/29/25 1476 1
일반
AI만능론의 진짜 위험성
nananatsume2
11/27/25
1978
1
AI만능론의 진짜 위험성
일반
nananatsume2
11/27/25 1978 1
C/C++
야매 C강의 2. 변수와 연산자
side-effect
11/03/25
1890
9
야매 C강의 2. 변수와 연산자
C/C++
side-effect
11/03/25 1890 9
C/C++
야매 C강의 1. 입출력
side-effect
11/02/25
1861
10
야매 C강의 1. 입출력
C/C++
side-effect
11/02/25 1861 10
일반
lua 배워보려는데 괜찮으려나
r1-ze
10/10/25
2538
0
lua 배워보려는데 괜찮으려나
일반
r1-ze
10/10/25 2538 0
일반
오랫만에 왔는데 섭 죽었네...
Ghost
09/17/25
2514
3
오랫만에 왔는데 섭 죽었네...
일반
Ghost
09/17/25 2514 3
일반
공항 예고 사건 진실
Ghost
08/21/25
10067
2
공항 예고 사건 진실
일반
Ghost
08/21/25 10067 2
일반
뮬바드 브라우저 코네 이미지 깨짐 해결 방법
Ghost
08/18/25
2183
0
뮬바드 브라우저 코네 이미지 깨짐 해결 방법
일반
Ghost
08/18/25 2183 0
일반
zig 쓰는 사람?
Ghost #0196f1ee
08/06/25
1825
0
zig 쓰는 사람?
일반
Ghost #0196f1ee
08/06/25 1825 0
기타언어
파이썬이랑 GDScript 문법 어느정도로 비슷함?
asdasdvwefcd
07/28/25
1686
1
파이썬이랑 GDScript 문법 어느정도로 비슷함?
기타언어
asdasdvwefcd
07/28/25 1686 1
일반
내년을 위해서 국비를 듣는데
sjaifo87498
07/27/25
2530
2
내년을 위해서 국비를 듣는데
일반
sjaifo87498
07/27/25 2530 2
일반
코딩 처음 시작하려는데
yaisibal1234
07/26/25
2330
0
코딩 처음 시작하려는데
일반
yaisibal1234
07/26/25 2330 0
C#
유니티 Singleton 1편
신군
07/08/25
3221
2
유니티 Singleton 1편
C#
신군
07/08/25 3221 2
일반
파이썬 배우다가 삼천포로 빠지는 느낌
shashasha
07/02/25
2433
0
파이썬 배우다가 삼천포로 빠지는 느낌
일반
shashasha
07/02/25 2433 0
PY
서버의 디스크 공간을 사용하지 않는 신개?념 이미지 공유 api
fastapi
06/17/25
3227
-1
서버의 디스크 공간을 사용하지 않는 신개?념 이미지 공유 api
PY
fastapi
06/17/25 3227 -1
C/C++
사칙연산이 없는 세계, 간단한 수식 연산기 ( 주의 )
comi-soft
06/14/25
3563
2
사칙연산이 없는 세계, 간단한 수식 연산기 ( 주의 )
C/C++
comi-soft
06/14/25 3563 2
C#
c#은 배우기 쉬운편임?
asdasdvwefcd
06/14/25
3179
0
c#은 배우기 쉬운편임?
C#
asdasdvwefcd
06/14/25 3179 0
📰
2000년대를 기점으로 나뉘는것
comi-soft
06/13/25
2978
1
2000년대를 기점으로 나뉘는것
📰
comi-soft
06/13/25 2978 1
s/turtleneckers
• 1,620 subscribers프로그래밍 서브입니다. 잡담, 문제 해결, 코드 리뷰(공지 필독)
Created 05/17/2025, 14:30:39
Rules
- 1. 기본 방임주의(절대 귀찮아서 그런 것 맞음)
- 2. 누가봐도 밴 당할법한 글 올리면 자를꺼임
- 3. 카테고리 지켜주면 좋겠지만 안지키면 안타까운거고