printf Programming Software Development by daredevil786 printf("\"My salary was increased by 15%%!\"\n"); why this prints "My salary was increased by 15%!" i think it should print %% instead of % Re: printf Programming Software Development by Adak I mis-read your post, so let's clarify: [CODE]printf("15%!"); //prints 15%! printf("15%%!"); //prints 15%! same as the first one [/CODE] If you want two % char's you need: [CODE]printf("15%%%!"); //prints 15%%![/CODE] Re: printf Programming Software Development by Adak Because the percent char is used internally, by the printf() function, as a part of a format specifier. In …essence, you're telling printf() to print out a value or variable, with the %!…. Which fails, because there is no %! format protocol, so printf() just prints out the exclamation point normally. It "eats… Re: printf Programming Software Development by creeps … [icode]![/icode] (a so-called [i]conversion specifier[/i]). [icode]printf("Hello, World%!");[/icode] will print [icode]Hello, World… Re: printf Programming Software Development by pheininger … it is finishing its description of the control string for printf, it says: "If the character after the % is not… Re: printf Programming Software Development by MareoRaft in fact, [CODE]printf("15%!"); //prints 15![/CODE] (note small syntax error above) ;) Re: Printf in C++ Programming Software Development by Narue printf sends output to stdout, which is the same destination as cout by default. Re: printf HELP!!! Programming Software Development by Narue …why it happens only in case of printf???[/QUOTE] It doesn't happen only with printf(): [code] #include <stdio.h…> void foo(int a, int b, int c) { printf("a =… %d\n", a); printf("b = %d\n", b); printf("c = %d\n… Re: printf Programming Software Development by ArkM …1st author of the printf source. There are many implementations of printf. Google search for "printf source code" … [url]http://www.menie.org/georges/embedded/index.html#printf[/url] [url]http://www.sparetimelabs.com/tinyprintf/index.html… Studio with RTL sources. Write your own printf (one week, including complete documentation ;))... Re: printf HELP!!! Programming Software Development by WaltP [QUOTE=ashok1514;]the parameters taking of printf function is from right to left..... So in the given …problem the function executes as follows.... b=1; printf("\n %d %d %d",b=15, b>… get this but why it happens only in case of printf???[/QUOTE] What makes you think it only happens with… Re: printf Programming Software Development by Narue … good from good programmers view Um, how do you think printf was written? Granted, cutedipti probably doesn't compare to the… is kind of insulting. By the way, the code for printf is long because it does a lot of work and… bit shorter. >Can we write a function similar to printf()? Yes, here's an example (possibly buggy, and longer than… Re: printf HELP!!! Programming Software Development by hackit [QUOTE=ashok1514;1648944]the parameters taking of printf function is from right to left..... So in the given …problem the function executes as follows.... b=1; printf("\n %d %d %d",b=15, b>… get this but why it happens only in case of printf??? Re: printf Programming Software Development by Narue …;writes" the functions. Generally every new compiler re-implements printf and most or all of the standard library and the… Re: printf HELP!!! Programming Software Development by ashok1514 the parameters taking of printf function is from right to left..... So in the given problem the function executes as follows.... b=1; printf("\n %d %d %d",b=15, b>9, b<9); So first it executes the condition b<9 but here b=1 next it executes the condition b>9. Here also b=1 and the last step is b=15 will executes......... printf Programming Software Development by policeachan it is known that dennis rithie made c with only 32 keywords and writing functions is the responsibility of the programmer. who wrote the functions printf, scanf . what is it's sourcr code? Re: printf Programming Software Development by WaltP [QUOTE=policeachan;691148]it is known that dennis rithie made c with only 32 keywords and writing functions is the responsibility of the programmer. who wrote the functions printf, scanf?[/QUOTE] Usually the author of the compiler that has the functions defined. printf Programming Software Development by cutedipti Hi, I have one query that: Can we write [B]a function similar to printf()[/B]? If it is possible then how could it be written? Re: printf Programming Software Development by dhingra the printf is defined in stdio.h and if you want to create similar fun. than you can create a function which can use a char constant format and return a int value so it is very unusual Re: printf Programming Software Development by stilllearning [URL="http://www.planetoid.org/technical/samples/va_args/va_args.c"]Here[/URL] is an example of a printf using va_args. Re: printf Programming Software Development by cutedipti … good from good programmers view Um, how do you think printf was written? Granted, cutedipti probably doesn't compare to the… printf Programming Software Development by ksaihat how can i use System.out.printf to depost value in dollars 2- the number that represent as percentage eg.4.0% whould be entered as 4.0 thanks printf HELP!!! Programming Software Development by hackit …; #include<conio.h> void main() { int B=1; printf("%d\n%d\n%d",b=15,b… Re: printf HELP!!! Programming Software Development by Narue … points and only accessed to determine the new value. Your printf() statement breaks the latter part of that rule. Even if… Printf does not work for a reason... Programming Software Development by anestistsoukalis … ÊÜíåé äéÜó÷éóç ôçò óõíäåäåìÝíçò ëßóôáò, áí äåí åßíáé êåíÞ. ¸îïäïò: ÅîáñôÜôáé áðü ôçí åðåîåñãáóßá */ { ListPointer CurrPtr; if (!EmptyLList(List)) { CurrPtr =List; while (CurrPtr != NilValue) { printf("(%d, %d, %f, %d) ",CurrPtr,Node[CurrPtr].Data… printf to cout problem Programming Software Development by mohamed.rani …;; a = 0x0ff0; b = 0xf00; c=a>>4; printf (format1,a,">>",4,c); c=a…&b; printf (format1,a,"&",b,c); c=a|…;,b,c); c=a^b; printf (format1,a,"^",b,c); c=~a; printf (format1,a,"~",b,c… printf and scanf doubt... Programming Software Development by Pavan_ …this line printing value of i and j...works fine printf("%d %d"); // this line again printing …value of i and j printf("%d"); // this line printing value of …; } [/CODE] On gcc compiler, 2nd and third printf() call taking value of i and j automatically.. but… printf and three string arguments Programming Software Development by majestic0110 … ERROR in StringComparisons.java (at line 20) System.out.printf("String a = %s String b = %s \… I am passing three String arguments to the printf method, which, as far as I can …this would correspond to the object varargs printf method. [QUOTE]printf public PrintStream printf(String format, Object... args) A… Re: printf and three string arguments Programming Software Development by quuba … String b + %s \n", a, b); System.out.printf(new String("String a = %s String b = %s \…n"), a, b); System.out.printf("String a " + "=" + " %s …; + "=" + " %s \n", a, b); System.out.printf("String a " + '=' + " %s String b " + … printf : weird++ Programming Software Development by tubby123 …[/B] , but this one is extremely weird. What does this printf statement mean ? What is %*d ????? [CODE]#include< iostream >…;%*d%*d",a,a,b,b); printf("\n"); printf("%d\n",sum); system("pause"); return… 0; }[/CODE] All i know is that printf returns the number of characters printed . printf in assembly Programming Software Development by Idestruction …code: [CODE]; Purpose: To print data to screen using printf ; Assemble: nasm -f elf -l printflab.lst printflab.…asm ; Link: gcc -o printflab printflab.o extern printf ; The C function to be called section .data ;… register push dword fmt ; address of ctrl string call printf ; Call C function loop back1 ; loop until ecx…