일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 |
- C언어 소스
- 알고리즘
- C언어
- 소스 구현
- 무료 Java
- 소프트웨어 접근성
- C++
- gof의 디자인 패턴
- C언어 소스 코드
- XML.NET
- 디딤돌 Java 언어 Part1
- C언어 표준 라이브러리 함수 가이드
- 디딤돌 C++
- 동적 메모리 할당
- C# 소스 코드
- 설계 패턴
- Escort GoF의 디자인 패턴
- C언어 표준 라이브러리 함수 사용법 가이드
- JAVA 언어
- StringBuffer 클래스
- java
- 파일 입출력
- 디딤돌 C언어
- String 클래스
- 클래스 다이어그램
- math.h
- 소스 파일
- C#
- 소프트웨어 설계
- 소스 코드
- Today
- 4
- Total
- 98,357
목록C언어 (294)
프로그램 소스
[C언어 소스] 콜백을 이용한 정렬 함수 구현 및 사용 예소스 코드#pragma warning(disable:4996) #include <stdio.h> #include <malloc.h> #include <memory.h> #include <string.h> typedef int (*Compare)(void *,void *); //비교한 결과를 반환하는 함수 포인터 정의 typedef struct _Stu..
[C언어 소스] 함수 포인터 변수를 사용하는 예소스 코드#include <stdio.h> typedef int(*Fun)(int,int); //함수 포인터 형식 Fun 정의 int Add(int a,int b); int Sub(int a,int b); int Mul(int a,int b); int Div(int a,int b); int main() { Fun arr[4] = {Add,Sub,M..
[C언어 소스] 장르별 도서 관리 프로그램실습 시나리오▶ 프로젝트 명: 장르별 도서 관리 프로그램 ▶ 개요 장르별 도서 관리 프로그램은 콘솔에서 동작하는 응용 프로그램입니다. ▶ 프로그램 흐름 프로그램을 시작하면 초기 작업으로 파일에 저장한 정보를 로딩합니다. 만약 파일이 없거나 비어있을 때는 초기 작업은 생략합니다. 초기 작업을 수행 후에는 최종 사용자에게 메뉴를 선택하게 하여 선택한 기능을 수행하는 ..
[C언어 소스] 회원 구조체 배열을 파일에 쓰기 및 읽기 테스트#include <stdio.h> #define FNAME "data.txt" #define MAX_MEMBER 4 #define MAX_NAME_LEN 20 typedef struct _Member Member; struct _Member { char name[MAX_NAME_LEN+1];..
[C언어 소스] fscanf_s 함수로 파일에서 입력받기#include <stdio.h> #define FILENAME "test.txt" int main() { char name[256]=""; int a=0,b=0,c=0,d=0; FILE *fp = 0; fopen_s(&fp..
[C언어 소스] fscanf_s 함수로 키보드에서 입력받기#include <stdio.h> int main() { char name[256]=""; int a=0, b=0, c=0, d=0; printf("이름:"); fscanf_s(stdin,"%s",name,sizeof(name)); &nb..
[C언어 소스] fprintf 함수로 특정 파일에 출력하기#include <stdio.h> #define FILENAME "test.txt" int main() { FILE *fp = 0; fopen_s(&fp, FILENAME,"w"); if(fp == 0)  ..
[C언어 소스] 사용자 정의 동적 배열(순차 보관) 사용자 정의 배열.zip//Member.h#pragma oncetypedef struct _Member Member;#define MAX_NAME_LEN 20struct _Member{ int mnum; char name[MAX_NAME_LEN];..
[C언어 소스] 사용자 정의 동적 배열(인덱스로 보관)//Member.h#pragma oncetypedef struct _Member Member;#define MAX_NAME_LEN 20struct _Member{ int mnum; char name[MAX_NAME_LEN];}; Member *New_Member(int mnum, const char *name);void De..
[C언어 소스] 학생 구조체 동적 메모리 할당//Student.h#pragma once typedef struct _Student Student;#define MAX_NAME_LEN 20struct _Student//학생{ char name[MAX_NAME_LEN];// 학생 이름 ..
[C언어 소스] 동적 할당한 메모리의 크기를 확장(realloc 함수 사용)#include <stdlib.h> #include <stdio.h> int *base = 0; //저장소의 위치 정보 int asize = 0; //현재 저장소의 용량 int usage = 0; //저장소에 보관한 요소 개수 void Input(int num); //저장소에 보관하기 void Resize();//저장소의 용량 변..
[C언어 소스] 기본 형식 동적 메모리 할당(calloc 함수 사용 예)#include <stdio.h> #include <stdlib.h> int main() { int *pi = (int *)calloc(1, sizeof(int)); //원하는 형식 포인터로 형변환 printf("초기: %d \n",*pi); *pi= 20;..
[C언어 소스] n명의 학생 성적 입력받아 출력(malloc 함수 사용)#include <stdio.h> #include <stdlib.h> void InputScores(int *base,int asize); //asize 명의 성적을 입력받는 함수 void ViewScores(int *base,int asize); //asize 명의 성적을 출력하는 함수 int InputScore(int num); //num ..
[C언어 소스] malloc 함수 사용 (기본 형식 메모리 동적 할당)#include <stdio.h> #include <malloc.h> int main() { int *pi = (int *)malloc(sizeof(int)); //원하는 형식 포인터로 형변환 printf("초기: %d \n",*pi); *pi= 20; //간..
[C언어 소스] 사용자 정의 형식 실습 - 학생실습 시나리오 학생은 학번, 이름, 체력, 지력, 스트레스, 연속으로 공부한 횟수를 멤버로 갖는다. 학번은 순차적으로 부여하며 이름은 생성할 때 입력인자로 전달받는다. 체력은 초기값이 100이며 0에서 100 사이의 값을 유지한다. 지력은 초기값이 100이며 0에서 200 사이의 값을 유지한다. 스트레스는 초기값이 0이며 0에서 100 사이의 값을 유지한다. 연속으로 공부..
[C언어 소스] 성별을 표현할 수 있는 Gender 열거형 정의#include <stdio.h> typedef enum _Gender Gender; enum _Gender{ FEMALE, MALE}; int main() { Gender g = FEMALE; if(g == FEMALE) { &nbs..
[C언어 소스] 공용체 하나의 멤버를 변경하면 다른 멤버의 값에 영향#include <stdio.h> typedef union _Demo Demo; union _Demo { int i; float f; }; int main() { Demo d; d.i = 90;  ..
[C언어 소스] 공용체와 구조체의 메모리 크기 비교#include <stdio.h> struct _SDemo { int a; int b; }; union _UDemo { int a; int b; }; int main() { printf("struct _SDemo 크기: %d\..
[C언어 소스] 구조체 비트 필드//구조체 비트 필드 #include <stdio.h> typedef struct _Data Data; struct _Data { unsigned char married:1; //1비트 배정 unsigned char hascar:1; //1비트 배정 unsigned char hashouse:1;..
[C언어 소스] 구조체 포인터 형식으로 멤버 사용#include <stdio.h> typedef struct _Point Point; struct _Point { double x; double y; }; void ViewPoint(Point *point); int main() { Point pt = {2,3}; &nb..
[C언어 소스] 구조체 형식으로 멤버 사용할 때 버그#include <stdio.h> #define MAX_NAME_LEN 20 typedef struct _Student Student; struct _Student { char name[MAX_NAME_LEN+1]; int iq; }; void Study(Student stu); int main() { &nb..
[C언어 소스] 구조체로 회원 형식 정의#include <stdio.h>#include <string.h>#define MAX_ID_LEN 20#define MAX_NAME_LEN 30#define MAX_ADDR_LEN 50typedef&n..
[C언어 소스] 문자열 복사(strcpy_s 함수, strncpy_s 함수)#include <stdio.h> #include <string.h> #define MAX_NAME_LEN 50 int main() { char name1[MAX_NAME_LEN+1] = "hello"; char name2[MAX_NA..
[C언어 소스] 부분 문자열 비교(strncmp 함수)#include <stdio.h> #include <string.h> #define MAX_NAME_LEN 50 int main() { char name1[MAX_NAME_LEN+1] = "hello"; char name2[MAX_NAME_LEN+1] = ..
[C언어 소스] 문자열 비교(strcmp 함수)#include <stdio.h> #include <string.h> #define MAX_NAME_LEN 50 int main() { char name1[MAX_NAME_LEN+1] = "hello"; char name2[MAX_NAME_LEN+1] = "hel..
[C언어 소스]유니코드와 ASCII 코드 문자열 길이#include <locale.h> #include <stdio.h> #include <string.h> int main() { char c ='a'; wchar_t wc = L'홍'; char name[10]="홍길동"; wchar..
[C언어 소스] char 형식 배열에 문자열 초기화#include <stdio.h> #define MAX_NAME_LEN 50 #define MAX_ADDR_LEN 100 int main() { char name[MAX_NAME_LEN+1] = {'a','b','c'}; &nbs..
[C언어 소스] 문자열에 관한 함수//디딤돌 C언어 http://ehpub.co.kr//문자열에 관한 함수#pragma warning(disable:4996)#include <stdio.h>#include <string.h>int main(){ char name[10] = ""; &nbs..
[C언어 소스] 배열과 포인터를 이용한 문자열 사용#include <stdio.h> int main() { char name1[6]="hello"; char name2[6]="hello"; const char *str1 = "yahoo"; const char *str2 = "yahoo"; &n..