Jul. 11th, 2014

netch80: (bird)
В питоне:

print '|%10%|' % ()
print '|%-10%|' % ()


выводит:

|         %|
|%         |


То же самое в перле и FreeBSD libc.

Но glibc выводит простой процент без расширения поля (две строки с |%|), gcc ругается, что формат неправильный, причём он в принципе не опознаёт такую возможность:

t.c:5: warning: conversion lacks type at end of format
t.c:5: warning: unknown conversion type character '|' in format
t.c:6: warning: conversion lacks type at end of format
t.c:6: warning: unknown conversion type character '|' in format


а C99 и Posix хором говорят "The complete conversion specification shall be %% ."

Profile

netch80: (Default)
netch80

January 2026

S M T W T F S
    1 23
45678910
11121314151617
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 4th, 2026 02:09 pm
Powered by Dreamwidth Studios