Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Implement the isgraph() : C

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 09-02-2010
Member
 
Join Date: Dec 2009
Posts: 28
Implement the isgraph() : C
  

Hello, I am the student of the Bsc-IT. I had learned the C language in first year of Bsc-IT. I can know about the functions in C language. I have to submit the assignment on the isgraph() function. So, I would like to know about the isgraph() function. I would also like to know how can I Implement the isgraph() function in C language. If there is anyone who can have the solution on the isgraph() functions then reply me!!!


Last edited by Gaauge : 09-02-2010 at 03:33 PM.
Reply With Quote
  #2  
Old 09-02-2010
Member
 
Join Date: Nov 2005
Posts: 1,323
Implement the isgraph() : C

Hi, The isgraph() function can checks except space for any printable character. The isgraph() function can be the member of the <ctype.h> header file. The isgraph() function can returns the zero if the argument of the isgraph() function can not be a printable character code. And returns the space or zero if the argument of the isgraph() function can be a printable character code. The following can be the syntax of the isgraph() function in the C language :
Code:
#include <ctype.h>
int isgraph( int d );

Last edited by absolute55 : 09-02-2010 at 03:49 PM.
Reply With Quote
  #3  
Old 09-02-2010
Member
 
Join Date: Oct 2005
Posts: 2,385
Program : Implement the isgraph()

Program :
Code:
#include <ctype.h>
#include <stdio.h>
  int main(void)
 {
    char C;
    for(;;) {
      C = getchar();
      if(isgraph(C)){
         printf("%c is printable\n", C);
      }
      if(C == '.'){
         break;
      }
    }
    return 0;
  }
Output :
Code:
1
1 is printable
2
2 is printable
3
3 is printable
4
4 is printable
.
. is printable
Reply With Quote
  #4  
Old 09-02-2010
Member
 
Join Date: May 2008
Posts: 2,373
The isgraph() : C

The following example of the isgraph() function can demonstrates you the working of the isgraph() function :
Code:
#include <stdio.h>
#include <ctype.h>
char ch[] = {'C', 0x09, ' ', 0x7d};
#define SIZE sizeof( ch ) / sizeof( char )
void main()
  {
    int k;
    for( k = 0; k < SIZE; k++ ) {
      printf( "Char %c is %sa printable character\n",
        ch[k],
        ( isgraph( ch[k] ) ) ? "" : "not " );
    }
  }
Output :
Code:
Char C is a printable character
Char     is not a printable character
Char   is not a printable character
Char } is a printable character
__________________
The FIFA Manager 2009 PC Game
Reply With Quote
  #5  
Old 09-02-2010
Member
 
Join Date: Feb 2008
Posts: 1,842
The isgraph()

Except than the ' ' space the isgraph() function can checks for any character that can be printable. Whenever the argument can not be a printable character then the isgraph() function can returns the zero. And When the argument can be a printable character then the isgraph() function can returns the non zero.
I hope you can understand about the isgraph() function from the above description.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Implement the isgraph() : C"
Thread Thread Starter Forum Replies Last Post
How to implement sum() faster in c#? Luis-Fernando Software Development 4 27-02-2010 08:25 PM
How can I implement the remove() in CPP Servant Software Development 5 22-02-2010 03:18 PM
Implement the copy_backward() in C++ Agustíne Software Development 5 16-02-2010 08:46 PM
Implement the equal_range() in C++ Garrick Software Development 5 15-02-2010 06:09 PM
How to implement IP Sec Enriquee Technology & Internet 5 12-01-2010 05:28 AM


All times are GMT +5.5. The time now is 06:58 PM.