Поиск по:jet.sao.ru -
Поискать по всем серверам
На этой странице приведены все страницы сервера jet.sao.ru ,которые мы индексируем. Показаны документы 1661 - 1680 из 5951.
Упорядочить по:
URL
|
дате изменения
1661. Простые программы и алгоритмы. Сюрпризы, советы. Хрестоматия по
Поговорим более подробно про область видимости имен. int x = 12; f (x){ int y = x*x; if(x) f (x - 1); } main (){ int x=173, z=21; f (2); } Локальные переменные и аргументы функции отводятся в стеке при вызове функции и уничтожаются при выходе из нее: -+ +- вершина стека |локал y=0 | ... Что напечатает программа? ... int x = 8; /* x2, перекрытие */ : | ... То ли по нему выдается из функции информация, то ли это просто указатель на данные (массив), передаваемые в функцию. ... Си в UNIX . ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/bogatyrev_c_unix/gl_1_5.shtml -- 20.9 Кб -- 02.10.2012
Похожие документы
Похожие документы
1662. Простые программы и алгоритмы. Сюрпризы, советы. Хрестоматия по
Напишите программу, которая устанавливает в 1 бит 3 и сбрасывает в 0 бит 6. ... Ответ: int x = 0xF0; x |= (1 << 3); x = ~(1 << 6); В программах часто используют битовые маски как флаги некоторых параметров (признак есть или нет). ... Множества принято моделировать при помощи битовых шкал: #define SET (n,a) (a[(n)/BITS] |= ... Алгоритм будет рекурсивным, например таким: в качестве первого элемента перестановки взять i -ый элемент массива. ... Си в UNIX . ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/bogatyrev_c_unix/gl_1_4.shtml -- 21.4 Кб -- 02.10.2012
Похожие документы
Похожие документы
1663. Process Control
... void abort(void) - Abort a process. int execl(char *path, char *argO, char *arg1,.. NULL) - Launch a child process (pass command line). int execlp(char *path, char *argO, char *arg1,.. ... int system(char *string) - Execute a UNIX (or resident operating system) command. ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/c_marshall/section2_21_9.html -- 2.9 Кб -- 02.10.2012
Похожие документы
Похожие документы
1664. Memory Allocation
. Next: Process Control Up: C Standard Library Functions Previous: Mathematics . #include <malloc.h> . void *calloc(size_t num elems, size_t elem_size) - Allocate an array and initialise all elements to zero . void free(void *mem address) - Free a block of memory. void *malloc(size_t num bytes) - Allocate a block of memory. void *realloc(void *mem address, size_t news i ze) - Reallocate (adjust size) a block of memory. Dave.Marshall@cm.cf.ac.uk . Wed Sep 14 10:06:31 BST 1994
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/c_marshall/section2_21_8.html -- 2.2 Кб -- 02.10.2012
Похожие документы
Похожие документы
1665. Mathematics
... int abs ( int n) - Get absolute value of an integer . double acos( double x) - Compute arc cosine of x. double asin( double x) - Compute arc sine of x. double atan( double x) - Compute arc tangent of x. double atan2( double y, double x) - Compute arc tangent of y/x. double ceil( double x) - Get smallest integral value that exceeds x ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/c_marshall/section2_21_7.html -- 3.9 Кб -- 02.10.2012
Похожие документы
Похожие документы
1666. Input and Output
. Next: Stream 1/0 Up: C Standard Library Functions Previous: File Manipulation . Stream 1/0 . Low level I/O . Dave.Marshall@cm.cf.ac.uk . Wed Sep 14 10:06:31 BST 1994
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/c_marshall/section2_21_6.html -- 2.1 Кб -- 02.10.2012
Похожие документы
Похожие документы
1667. File Manipulation
... include <sys/stat.h> and #include <sys/types.h> . int chmod(char *path, int pmode) - Change permission settings of a file. int fstat(int handle, struct stat *buffer) - Get file status information. int remove(char *path) - Delete a named file. int rename(char *oldname, char *newname) - rename a file. int stat(char *path, struct stat *buffer) - Get file status information of named file. unsigned umask(unsigned pmode) - Set file permission mask. ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/c_marshall/section2_21_5.html -- 2.4 Кб -- 02.10.2012
Похожие документы
Похожие документы
1668. Directory Manipulation
. Next: File Manipulation Up: C Standard Library Functions Previous: Data Conversion . #include <dir.h> . int chdir(char *path) - Change current directory to given path. char *getcwd(char *path, int numchars) - Returns name of current working directory. int mkdir(char *path) - Create a directory u sing given path name. int rmdir(char *path) - Delete a specified directory. Dave.Marshall@cm.cf.ac.uk . Wed Sep 14 10:06:31 BST 1994
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/c_marshall/section2_21_4.html -- 2.2 Кб -- 02.10.2012
Похожие документы
Похожие документы
1669. Data Conversion
Next: Directory Manipulation Up: C Standard Library Functions Previous: Character Classification and Conversion . ... double atof( char * string ) - Convert string to floating point value . int atoi( char * string ) - Convert string to an integer value . int atol( char * string ) - Convert string to a long integer value . char *itoa( int value , char * string , int radix ) - Convert an integer value to a string using given ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/c_marshall/section2_21_3.html -- 2.6 Кб -- 02.10.2012
Похожие документы
Похожие документы
1670. Character Classification and Conversion
... int iscntrl( int c) - True if c is a control character . int isdigit( int c) - True if c is a decimal digit . int isgraph( int c) - True if c is a graphical character . int islower( int c) - True if c is a lowercase letter . int isprint( int c) - True if c is a printable character . int ispunct ( int c) - True if c is a punctuation tolower(int c) - Convert c to lowercase. int toupper(int c) - Convert c to uppercase. ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/c_marshall/section2_21_2.html -- 2.8 Кб -- 02.10.2012
Похожие документы
Похожие документы
1671. Buffer Manipulation
... void *memchr (void *s, int c, size_t n) - Search for a character in a buffer. int memcmp (void *s1, void *s2, size_t n) - Compare two buffers. void *memcpy (void *dest, void *src, size_t n) - Copy one buffer into another . void *memmove (void *dest, void *src, size_t n) - Move a number of bytes from one buffer lo another. void *memset (void *s, int c, size_t n) - Set all bytes of a buffer to a given character. ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/c_marshall/section2_21_1.html -- 2.4 Кб -- 02.10.2012
Похожие документы
Похожие документы
1672. Process Control and Management
Next: Running UNIX Commands from C Up: UNIX and C Previous: errno . A process is basically a single running program. ... When UNIX runs a process it gives each process a unique number - a process ID, pid . The UNIX command ps will list all current processes running on your machine and will list the pid. The C function int getpid() will return the pid of process that called this function. ... Running UNIX Commands from C . ... Piping in a C program . ... Interrupts and Signals . ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/c_marshall/section2_18_4.html -- 3.8 Кб -- 02.10.2012
Похожие документы
Похожие документы
1673. File and Directory Manipulation
. Next: Directory handling functions Up: UNIX and C Previous: Using UNIX System Calls and Library Functions . There are many UNIX utilities that allow us to manipulate directories and files. cd, ls, rm, cp, mkdir etc. are examples we have (hopefully) already met. We will now see how to achieve similar tasks from within a C program. Directory handling functions . File Manipulation Routines . errno . Dave.Marshall@cm.cf.ac.uk . Wed Sep 14 10:06:31 BST 1994
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/c_marshall/section2_18_3.html -- 2.5 Кб -- 02.10.2012
Похожие документы
Похожие документы
1674. Using UNIX System Calls and Library Functions
... To use system calls and library functions in a C program we simply call the appropriate C function (Appendix ). We have already met some system calls when dealing with low level I O - open(), creat(), read(), write() and close() are examples. ... All math functions such as sin(), cos(), sqrt() and random number generators - random(), seed(), lrand48(), drand48() etc. are standard math library functions. NOTE: most standard library functions will use system calls within them. ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/c_marshall/section2_18_2.html -- 3.4 Кб -- 02.10.2012
Похожие документы
Похожие документы
1675. Advantages of using UNIX with C
Next: Using UNIX System Calls and Library Functions Up: UNIX and C Previous: UNIX and C . Portability - UNIX, or a variety of UNIX, is available on many machines. Programs written in standard UNIX and C should run on any of them with little difficulty. ... File handling - hierarchical file system with many file handling routines. Shell Programming - UNIX provides a powerful command interpreter that understands over 200 commands and can also run UNIX and user-defined programs. ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/c_marshall/section2_18_1.html -- 3.1 Кб -- 02.10.2012
Похожие документы
Похожие документы
1676. Running Make
Next: UNIX and C Up: Writing Larger Programs Previous: Make macros . Simply type make from command line. UNIX automatically looks for a file called Makefile (note: capital M rest lower case letters). So if we have a file called Makefile and we type make from command line. The Makefile in our current directory will get executed. We can override this search for a file by typing make -f make_filename . e.g. ~ make -f my_make . ... Wed Sep 14 10:06:31 BST 1994 ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/c_marshall/section2_17_7.html -- 2.3 Кб -- 02.10.2012
Похожие документы
Похожие документы
1677. Текстовая обработка. Хрестоматия по программированию на Си в Unix
... Разработайте простую версию препроцессора для обработки операторов #define . ... языка Си в обратную польскую запись. /* jmp_buf */ jmp_buf AGAIN; /* контрольная точка */ err a b c * + */ /* стек вычислений */ # define MAXDEPTH 20 /* глубина стеков */ int sp; /* указатель стека (stack pointer) */ double stk[MAXDEPTH]; double dpush (d) double d; /* занести число в стек */ { if( sp == MAXDEPTH ){ printf( Стек операндов полон\n );err(1);} else return ( stk[sp++] = d ); } double ... Си в UNIX . ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/bogatyrev_c_unix/gl_7_6.shtml -- 16.2 Кб -- 02.10.2012
Похожие документы
Похожие документы
1678. Текстовая обработка. Хрестоматия по программированию на Си в Unix
... Символ \ отменяет спецзначение метасимвола. */ int match (register char *s, register char *p) { register int scc; /* текущий символ строки */ int c, cc, lc; /* lc - предыдущий символ в [...] списке */ int ok, notflag; for (;;) { scc = U(*s++); /* очередной символ строки */ switch (c = U (*p++)) { /* очередной символ шаблона */ case QUOT: /* a*\*b */ c = U (*p++); if( c == 0 ) return (0); /* ошибка: pattern\ */ else goto def; ... Си в UNIX . ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/bogatyrev_c_unix/gl_7_4.shtml -- 22.6 Кб -- 02.10.2012
Похожие документы
Похожие документы
1679. Простые программы и алгоритмы. Сюрпризы, советы. Хрестоматия по
Почему программа зацикливается и печатает совсем не то, что нажато на клавиатуре, а только 0 и 1? while ( c = getchar() != 'e') printf("%d %c\n, c, c); Ответ: данный фрагмент должен был выглядеть так: while ((c = getchar()) != 'e') printf("%d %c\n, c, c); Сравнение в Си имеет высший приоритет, нежели присваивание! ... Оформите алгоритм как функцию с переменным числом параметров: poly ( x , n , an , an - 1 , ... a0 ); О том, как это сделать - читайте раздел руководства по UNIX man varargs . ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/bogatyrev_c_unix/gl_1_6.shtml -- 18.4 Кб -- 02.10.2012
Похожие документы
Похожие документы
1680. Простые программы и алгоритмы. Сюрпризы, советы. Хрестоматия по
Почему printf("%d\n", '\377' == 0377 ); printf("%d\n", '\xFF' == 0xFF ); печатает 0 (ложь)? ... Рассмотрим программу int main(int ac, char **av){ int c; while((c = getchar()) != ... Решений существует два: первое - превратить unsigned char в int . ... Программа печатает либо x=1 либо x=0 в зависимости от КОМПИЛЯТОРА - вычисляется ли раньше правая или левая часть оператора вычитания: void main(){ int c = 1; int x = c - c++; printf( "x=%d c=%d\n", x, c ); exit(0); } Что вы имели в виду ? ... Си в UNIX . ...
[
Сохраненная копия
]
Ссылки http://jet.sao.ru/hq/sts/linux/book/bogatyrev_c_unix/gl_1_3.shtml -- 17.4 Кб -- 02.10.2012
Похожие документы
Похожие документы