Search:

Type: Posts; User: optimizer_777

Search: Search took 0.03 seconds.

  1. Replies
    6
    Views
    1,367

    Hi Tclausex, Thank you. I have a...

    Hi Tclausex,
    Thank you.
    I have a somewhat decent Perl background and I am just learning C.

    In Perl, we can do something as:


    my @words = ();
  2. Replies
    6
    Views
    1,367

    Help with word counting problem

    Hi,
    I am trying to write a small program that counts the number of times a 1 letter, 2 letter, 3 letter, 4 letter etc. words occur and print the frequency of their occurance as:

    1 letter - 1
    2...
  3. Replies
    1
    Views
    700

    Clarification on getchar()

    Hi,
    I have a simple code as below (from K&R):


    #include <stdio.h>
    #include <stdlib.h>
    // simple character counting
    int main()
    {
    int c;
  4. Replies
    5
    Views
    2,321

    Tim, Thank you. If we change isdigit...

    Tim,
    Thank you.

    If we change isdigit to isalpha, and change the atoi function to something as below:

    char atoi(char s[])
    {
    int i, n, sign;
    for (i = 0;...
  5. Replies
    5
    Views
    2,321

    iMalc, Thank you. If my char s[] has a value...

    iMalc, Thank you.

    If my char s[] has a value as below:


    char s[] = "-13572 468";


    I see that the value returned is
    -13572
  6. Replies
    5
    Views
    2,321

    K&R Page 61 atoi function example

    Hi,
    I am just trying to see how to run the atoi code on Page 61. I wrote the following but the below code prints just 0.

    Can anyone please help? Thank you.

    Note: I just want to thank the...
  7. I am still not understanding why we need the...

    I am still not understanding why we need the following code in the above program:



    for ( ; --lim > 0; w++) {
    if (!isalnum(*w = getch())) {
    ...
  8. Hi, I changed it back to ...

    Hi,
    I changed it back to
    while(isspace(c=getch()))

    I see that the results are the same before and after changing the code back to
    while(isspace(c=getch()))
  9. K&R pages 134-136 help with structures please

    Hi,
    I am a beginner trying to learn C on my own. I am reading and running the programs in K&R. I am not able to clearly understand what is going on in the following program's getword function.
    ...
  10. Replies
    11
    Views
    1,791

    Cannot run program on page 97 in K&R

    Hi friends,
    I am new to C programming.
    I am trying to run the following program from K&R pages 96 and 97, but it prints garbage. Can any one please help? What am I doing wrong?

    Thank...
Results 1 to 10 of 10