User Profile

Collapse

Profile Sidebar

Collapse
gurutheexpert
gurutheexpert
Last Activity: Dec 11 '06, 11:32 AM
Joined: Nov 30 '06
Location: Pune
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • gurutheexpert
    replied to Prime Number Function
    in C
    Hi ,

    You can declare the function as You have done

    int Prime (int TestNumber);
    implementation:

    Code:
    int Prime (int TestNumber)
    {
     
      int IsPrime; 
      // Here write the logic for testing a number to be prime and return 
     // set value of IsPrime accordingly in logic
     return IsPrime;
    }
    Second fuction is
    Code:
     
    void
    ...
    See more | Go to post

    Leave a comment:


  • gurutheexpert
    replied to need some help
    in C
    A scanf statement is used to accept input. It has 2 parameters -
    1st - Format Specifier : it tells the compiler in what format input is to be stored.
    various formats may be "%d "-> for integer , "%c" , for character "%f" for
    floats.

    2nd - parameter is the address of memory where your input is two be stored.
    Like your 'no' should be a variable and...
    See more | Go to post

    Leave a comment:


  • look at
    http://gimpel-online.com/MsgRef.html...
    See more | Go to post

    Leave a comment:


  • gurutheexpert
    replied to base class pointers
    in C
    Hi,
    can you clarify your doubt?
    "what i'm trying to do is have one class contain base class pointers to each
    derived class ( of another base class ) ... "

    Can you explain with example what yoou wana do? Only then i can help you.
    What do you mean by "( of another base class )"?

    Let me make it clear that a Base Class pointer is a pointer that...
    See more | Go to post

    Leave a comment:


  • gurutheexpert
    replied to C Problem
    in C
    hi,
    Sure. What errors ,as far as I know , there are no errors in this program. I have tested it . Let me know ....
    See more | Go to post

    Leave a comment:


  • gurutheexpert
    replied to C Problem
    in C
    Hi,

    One more thinhg ,your while loop is to decide when to stop reading . Until ReadRealyLongTe xtLine() doesn't return NULL , it isn't going to terminate.

    Here ReadRealyLongTe xtLine() returns NULL only when whole line is read.
    Only thing is that you have a slight trade of betwwen execution time ie. ReadRealyLongTe xtLine function will be called more times , if line size is large.

    But it is upto...
    See more | Go to post

    Leave a comment:


  • gurutheexpert
    replied to C Problem
    in C
    Hi,

    If line contains more than 1000 chars , then it will return the chars in chunks of 999 at one time until the line ends or end of file is reached.

    I think u haven't noticed the bool variable and comment written there. it is a static variable whose status will change to "false" only when new line starts or end of file reached and then it will return NULL which will terminate ur while int Print ();...
    See more | Go to post

    Leave a comment:


  • gurutheexpert
    replied to C Problem
    in C
    Hi,
    This is my first post. I have found a solution . Any suggestions are welcome.


    #include <stdio.h>
    #include <memory.h>

    char * ReadRealyLongTe xtLine(FILE * p_fhInFile)
    {
    // status variable to decide whether to continue reading or not
    static bool bContinue = true;

    // create a buffer of suitabele size in my case i took 1000
    static...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...