qazwsx
چهارشنبه 15 فروردین 1386, 17:31 عصر
اگه کسی بخواد نحوه پیاده سازی بعضی از توابع مثل printf یا scanf رو ببینه سورس اونو از کجا باید بدست بیاره
linux
چهارشنبه 15 فروردین 1386, 18:05 عصر
اگه کسی بخواد نحوه پیاده سازی بعضی از توابع مثل printf یا scanf رو ببینه سورس اونو از کجا باید بدست بیاره
می توانی سورس کامپایلر gcc را از این سایت بگیری
http://gcc.gnu.org/ و مطالعه کنی
Identifier
چهارشنبه 15 فروردین 1386, 18:07 عصر
گه کسی بخواد نحوه پیاده سازی بعضی از توابع مثل printf یا scanf رو ببینه سورس اونو از کجا باید بدست بیاره
برای سوالش عنوان مناسب انتخاب میکنه
Arash_j13
پنج شنبه 16 فروردین 1386, 21:16 عصر
سورسشون همراه C++ Builder هست مثلا
/*-----------------------------------------------------------------------*
* filename - scanf.c
*
* function(s)
* scanf - gets formatted input from stdin
*-----------------------------------------------------------------------*/
/*
* C/C++ Run Time Library - Version 11.0
*
* Copyright (c) 1987, 2004 by Borland Software Corporation
* All Rights Reserved.
*
*/
/* $Revision: 9.3 $ */
#include <stdarg.h>
#include <stdio.h>
#include <_stdio.h>
#include <_scanf.h>
#include <_tchar.h>
#undef ungetc /* remove the macro version */
/*---------------------------------------------------------------------*
Name scanf - gets formatted input from stdin
Usage int scanf(const char *format[, argument ...])
Prototype in stdio.h
Description gets formatted input from stdin
Return value number of fields scanned and stored. scanf returns EOF
if an attempt is made to read at end-of-file
*---------------------------------------------------------------------*/
int _RTLENTRY _EXPFUNC _tscanf(const _TCHAR *fmt, ...)
{
va_list ap;
int ret;
va_start(ap,fmt);
_lock_stream(stdin);
ret = _scannert( (int (*)(void *))_fgettc,
(void (*)(int, void *))_ungettc,
stdin,
fmt,
ap);
_unlock_stream(stdin);
va_end(ap);
return (ret);
}
/*-----------------------------------------------------------------------*
* filename - printf.c
*
* function(s)
* printf - send formatted output to stdout
*-----------------------------------------------------------------------*/
/*
* C/C++ Run Time Library - Version 11.0
*
* Copyright (c) 1987, 2004 by Borland Software Corporation
* All Rights Reserved.
*
*/
/* $Revision: 9.4 $ */
#include <stdio.h>
#include <_printf.h>
#include <_stdio.h>
#include <_tchar.h>
/*---------------------------------------------------------------------*
Name printf - send formatted output to stdout
Usage int printf(const char *format, ...);
Prototype in stdio.h
Description sends formatted output to stdout
Return value the number of bytes output. In the event of an
error, printf returns EOF.
*---------------------------------------------------------------------*/
int _RTLENTRY _EXPFUNC _tprintf(const _TCHAR *fmt, ...)
{
va_list ap;
int ret;
va_start(ap,fmt);
_lock_stream(stdout);
ret = __vprintert ((putnF *)__fputnt, stdout, fmt, 0, 0, ap);
_unlock_stream(stdout);
va_end(ap);
return (ret);
}
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.