netch80: (bird)
[personal profile] netch80
В питоне:

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 %% ."
(will be screened)
(will be screened if not validated)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

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. 3rd, 2026 11:39 pm
Powered by Dreamwidth Studios