Value that corresponds to the %n format specifier must be a pointer to a variable. - C Language Basics

C examples for Language Basics:printf

Introduction

After the call to printf( ) has returned, this variable will hold the number of characters output, up to the point at which the %n was encountered.

Demo Code

#include <stdio.h>

int main(void)
{
   int count;//from   w w w.j  av  a2 s .  c  o m

   printf("this%n is a test\n", &count);
   printf("%d", count);

   return 0;
}

Related Tutorials