User:Megan Hoogenboom/assignment4: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with "== Finding text and replacing == <source lang=C> #include "stdio.h" #include "string.h" #include "ctype.h" void main() { char a = 'a'; if (ispunct(a)) { printf("...")
 
Line 1: Line 1:
== Finding text and replacing ==
== Finding text and replacing in C==


<source lang=C>
<source lang=C>
Line 17: Line 17:
     }
     }
     printf("\n");
     printf("\n");
}
</source>
<source lang=C>
#include "stdio.h"
#include "string.h"
#define MAXLINE 1000
int main () {
    char line[MAXLINE];
    int linelen;
    int i;
    char a = '1';
        if (ispunct(a)) {
            printf("CHAR\n");
        }
        printf("\n");
    return 0;
}
}


</source>
</source>

Revision as of 02:20, 9 November 2010

Finding text and replacing in C

#include "stdio.h"
#include "string.h"
#include "ctype.h"
 
void main() {

char a = 'a';

    if (ispunct(a)) {
        printf("CHAR\n");
        }
    else {
        printf("NOCHAR\n");
    }
    printf("\n");
}
#include "stdio.h"
#include "string.h"
#define MAXLINE 1000
 
int main () {
    char line[MAXLINE];
    int linelen;
    int i;
    char a = '1';

        if (ispunct(a)) {
             printf("CHAR\n");
        }
        printf("\n");
 
    return 0;
}