전체 글
-
strchr 사용법 (strchr usage)C language 2017. 8. 8. 02:58
strchr 함수를 사용하기위해 간단한 프로그램으로 테스트 해보았다.아래를 보면 fgets 함수를 이용하여 문자열을 받을경우, 아래 결과와 같이 문자열 마지막에 개행문자 '\n'가 추가되어 출력이 저런식으로 되는것을 볼수있다. I have tested it with a simple program to use the strchr function.If you get a string using the fgets function below, you can see that the newline character '\ n' is appended to the end of the string as shown in the output below#include int main(void) { char line[40]; pu..
-
strcpy() 함수 사용법 (strcpy() function usage)C language 2017. 8. 4. 01:48
strcpy() 함수는 문자열을 복사하는 함수이다. 전달인자를 2개를 받고 왼쪽에는 타겟이고 오른쪽은 소스이다 . 소스에서 타깃으로 복사한다고 생각하면 쉽다. 아래 프로그램은 처음에 temp 에 사용자입력을 받고 , 입력한 단어 첫번째 글자가 'a' 가 아닐경우 카운트를 세지 않아 무한 'a'로 시작하는 단어를 입력할때 까지 무한 반복된다. strcpy () function copies the string, the function gets two parameters, the left is the target, and the right is the source. It's easy to think of it as copying to target from source. The following program ..
-
Pickle 모듈 사용법 (Pickle module usage)Python 2017. 8. 3. 20:38
import pickle # # imelda = ('More Mayhem', # 'IMelda May', # '2011', # ((1, 'Pulling the Rug'), # (2, 'Psycho'), # (3, 'Mayhem'), # (4, 'Kentish Town Waltz'))) # # with open("imelda.pickle", 'wb') as pickle.file: # pickle.dump(imelda, pickle.file) # # # with open("imelda.pickle", 'rb') as imelda_pickled: # imelda2 = pickle.load(imelda_pickled) # # print(imelda2) # # album, artist, year, track_li..
-
타임 모듈 사용법 (Time module usage)Python 2017. 8. 3. 20:35
# import time # print(time.gmtime(1)) # print(time.gmtime(1)) # # print(time.localtime()) # print(time.time()) # # time_here = time.localtime() # print(time_here) # print("Year:",time_here[0],time_here.tm_year) # print("Month:",time_here[1],time_here.tm_mon) # print("Day:",time_here[2],time_here.tm_mday) # # # tstamp = str(time_here.tm_year) +"년 "+str(time_here.tm_mon) + "월 "+ str(time_here.tm_m..
-
Turtle 모듈 사용법(Turtle module usage)Python 2017. 8. 3. 20:34
# import turtle # import time # # turtle.forward(150) # turtle.right(250) # turtle.forward(150) # # turtle.done() # from turtle import forward, right, done # import turtle # # forward(150) # right(250) # turtle.circle(75) # forward(150) # # done() from turtle import * forward(150) right(250) circle(75) forward(150) done() it’s pretty fun; you guys better to try
-
Shelve & dir 모듈 사용법 (Shelve, dir module usage)Python 2017. 8. 3. 20:32
import shelve with shelve.open("bike2") as bike: # bike["make"] = "honda" # bike["model"] = "250 dream" # bike["colour"] = "red" # bike["engine_size"] = 250 # del bike['engin_size'] for key in bike: print(key) print('=' * 40 ) print(bike["engine_size"]) # print(bike["engin_size"]) print(bike["colour"]) import shelve import shelve # # with shelve.open('ShelfTest') as fruit: # # fruit = {"oragne" ..
-
strlen() 함수 사용법 (strlen() fuction usage)C language 2017. 8. 1. 21:29
C에서 많은 문자열 함수를 제공하고있다. 이번 포스팅에서는 글자수를 셀수있는 함수 strlen() 에 대해서 알아본다.strlen() 함수는 글자뿐아니라 스페이스 . , ;' 등과 같은 표기까지 숫자를 센다. 마지막 종결 널문자 '\0'는 포함하지 않는다. 아래를 보면 간단한 프로그램으로 테스트 해보았다. C provides many string functions. In this post we will look at the strlen () function which can count the number of characters. strlen() fuction counts include space ,.' etc.. not only character This function does not count th..