Thread: Urgent Help needed!

  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    1

    Urgent Help needed!

    Code:
    #include <stdio.h>
    #define MAXSTRLEN    255
    
    main ()
    {     /*main*/
       char       *CurCharPtr;
       char       String [MAXSTRLEN];
    
       printf("Enter a line of text:"); /*write a prompt*/
       fgets(String,MAXSTRLEN,stdin);   /*read the line*/
    
       /*Print a character until found
       *a zero terminator is found
       */
    
       for (CurCharPtr= &string[0]; *CurCharPtr!='\0';
       CurCharPtr++)
    
    
       printf("The next character is %c\n", *CurCharPtr);
    
    }
       /*main*/

    How do i rewrite the above program by simplifying it using array and pointer references?

  2. #2
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    this is C not C++

  3. #3
    Registered User
    Join Date
    Oct 2009
    Location
    While(1)
    Posts
    377
    I think you are already using arrays about pointer you are still using what do u want

  4. #4
    Registered User
    Join Date
    Apr 2004
    Location
    Ohio
    Posts
    147
    Google stringstring, string and cin. Viola, problem solved.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Urgent Help Needed In Writing Algorithm!!
    By Vikramnb in forum C++ Programming
    Replies: 1
    Last Post: 01-09-2009, 12:46 PM
  2. boolean algebra....urgent help needed!
    By Saimadhav in forum C++ Programming
    Replies: 1
    Last Post: 07-28-2008, 07:22 AM
  3. Urgent Needed - PERL
    By beely in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 07-02-2002, 08:09 PM
  4. Help Needed: Borland C++ 5.5 Installation - URGENT!
    By Linette in forum C++ Programming
    Replies: 12
    Last Post: 03-09-2002, 06:44 PM