User Profile

Collapse

Profile Sidebar

Collapse
pete ritter
pete ritter
Last Activity: Mar 19 '11, 10:54 PM
Joined: Dec 3 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • pete ritter
    replied to How to use isdigit function?
    in C
    what should I initialize it as? a pointer?
    See more | Go to post

    Leave a comment:


  • pete ritter
    replied to How to use isdigit function?
    in C
    Would I want to assign the null at the end of the array, something like this.
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <ctype.h>
    
    int main(int argc, char *argv[])
    {
    	
           	char student [100];
           	char num [100];
           	int con [100];
           	char i = 0;
           	
           	int k,m,j,n = 0;
    ...
    See more | Go to post

    Leave a comment:


  • pete ritter
    replied to How to use isdigit function?
    in C
    Yes you were right in geussing the types except for student, i made student an array that the file is being read into. Also i apologize for not using the code tags.

    I changed it around a bit and this is what I have now:
    Code:
    int main(int argc, char *argv[])
    {
    	
           	char   student [100];
           	char num [100];
           	int con [100];
           	char i = 0;
           	
           	int k,m,j,n
    ...
    See more | Go to post

    Leave a comment:


  • pete ritter
    started a topic How to use isdigit function?
    in C

    How to use isdigit function?

    Hi,

    I am trying to use the isdigit function to extract digits from an array containing a string file. What I am wondering is if the variable used in it can be a char?

    this is what I have,

    for(k=0;k<10;k+ +)

    {
    i = student [k];

    if( isdigit(i))

    num [j] = i;

    j++;

    printf("%s",num );
    ...
    See more | Go to post
No activity results to display
Show More
Working...