Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Non-printable characters

Non-printable characters

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kfaday
    wrote on last edited by
    #1

    Hello, i'm doing a simple ansi c console application. i'm reading a file Now, i have to print its characters, and if i find a non-printable character i'd like to write a . or , or whatever. i've got this code that prints everything:

    while (Cantidad>0)
    {
    	c=getc(Arch);
    	if (c!=EOF)
    		printf("%c",c);
    	else
    	{
    		printf("eof.\\n");
    		return 1;
    	}
    	Cantidad--;
    }	
    

    how do i check if c is a non-printable character? thanks!

    R 1 Reply Last reply
    0
    • K kfaday

      Hello, i'm doing a simple ansi c console application. i'm reading a file Now, i have to print its characters, and if i find a non-printable character i'd like to write a . or , or whatever. i've got this code that prints everything:

      while (Cantidad>0)
      {
      	c=getc(Arch);
      	if (c!=EOF)
      		printf("%c",c);
      	else
      	{
      		printf("eof.\\n");
      		return 1;
      	}
      	Cantidad--;
      }	
      

      how do i check if c is a non-printable character? thanks!

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      isprint() /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

      K 1 Reply Last reply
      0
      • R Ravi Bhavnani

        isprint() /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

        K Offline
        K Offline
        kfaday
        wrote on last edited by
        #3

        thanks!! that function solved it!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups