Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: C programming

  1. #1

    Default C programming


    unsaon pag identify and count sa special characters within an inputted string

  2. #2

  3. #3
    Elite Member
    Join Date
    Aug 2008
    Posts
    1,053
    Blog Entries
    1
    the TS asking about C string.. which is different if dealing with C++ strings

  4. #4
    @MarkCuerting => Why don't you give him what he wants because I think you know a lot more than I do. As I posted, Don't you understand the meaning of this? "Hope this can help" Or you are just here to look what you think is mistake of other people.
    Last edited by johnsital; 07-20-2010 at 02:33 PM. Reason: Update...

  5. #5
    use string.h and use strlen() function:

    ex:
    {
    int x;
    char name[30] = 'MARK';

    x=strlen(name);
    printf("Character count = %d",x);
    }

    //mao na xa...try it!!

  6. #6
    Elite Member
    Join Date
    Aug 2008
    Posts
    1,053
    Blog Entries
    1
    I don't if the TS will come back soon LOL...

  7. #7
    Quote Originally Posted by mark2sad View Post
    use string.h and use strlen() function:

    ex:
    {
    int x;
    char name[30] = 'MARK'; //Mag-error tingali ni diri no?In Python, this is fine but in C, I think murag mag-error ni diri..

    x=strlen(name);
    printf("Character count = %d",x);
    }

    //mao na xa...try it!!
    That is only to determine the length of the string.
    Inorder to solve the 2nd problem, regarding, how many special characters in a string:

    void main()
    {
    int x;
    int count;
    char name[30] = "b@r3f00t!";

    x=strlen(name);
    printf("Character count = %d",x);

    for(i=0; i<x; i++)
    if(!isalnum(name[i]))
    count++;

    printf("\nNumber of Special Characters: %d", count);
    getch();
    }

    - dugay2 nako wala magprogram ug C (nya diretso ra pud ko reply diri) so basin naa ko sayup ani...pero try lang na ug padagan....

  8. #8
    daghang salamat sa nag post! bro b@refoot!!salamat kayo..

  9. #9
    maau dyud ni si b@r3f00t da.... saludo ko nmo bro...

  10. #10
    no probs.
    I just hope it helped!

  11.    Advertisement

Page 1 of 2 12 LastLast

Similar Threads

 
  1. Replies: 10799
    Last Post: 09-19-2020, 06:06 PM
  2. what is your favorite programming language?
    By sachem in forum Programming
    Replies: 310
    Last Post: 10-08-2015, 03:11 PM
  3. XDA2: file shortcut not removed after program uninstalled
    By c_cebrecus in forum Gizmos & Gadgets (Old)
    Replies: 5
    Last Post: 05-28-2008, 02:10 AM
  4. excel programs; needs help guys!!!
    By rufo in forum Software & Games (Old)
    Replies: 3
    Last Post: 01-14-2006, 12:18 PM
  5. Web programming like PHP, ASP, HTML AND FLASH ANIMATIONS
    By michaxze in forum Websites & Multimedia
    Replies: 10
    Last Post: 07-30-2005, 05:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top