Thread: obtaining telephone number

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    9

    Post obtaining telephone number

    hello friends,
    i wonder if u can help me in writting a code that is able to obtain the phone number on the local machine.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Code:
    #include <stdio.h>
    
    int main(void)
    {
        char phone[BUFSIZ];
    
        printf("Hello User, enter your phone number: ");
        fflush(stdout);
    
        if (fgets(phone, sizeof (phone), stdin))
            printf("Your phone number is %s", phone);
    
        return 0;
    }
    Use this code at your own risk, the user may be an idiot.
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Oct 2002
    Posts
    385
    Dang Prelude, you just made me fall out of my chair laughing.
    Wandering aimlessly through C.....

    http://dbrink.phpwebhosting.com

  4. #4
    Registered User
    Join Date
    Jun 2003
    Posts
    9

    funny

    Originally posted by Prelude
    Code:
    #include <stdio.h>
    
    int main(void)
    {
        char phone[BUFSIZ];
    
        printf("Hello User, enter your phone number: ");
        fflush(stdout);
    
        if (fgets(phone, sizeof (phone), stdin))
            printf("Your phone number is %s", phone);
    
        return 0;
    }
    Use this code at your own risk, the user may be an idiot.
    well, i wonder if u are insulting me by this ??
    well, i was trying to makle a trojan that will obtain the phone number then sending it to an e mail ??????

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826

    Re: funny

    Originally posted by system_eyes
    well, i wonder if u are insulting me by this ??
    well, i was trying to makle a trojan that will obtain the phone number then sending it to an e mail ??????
    You're in the wrong place. Go away.

    Quzah.
    Hope is the first step on the road to disappointment.

  6. #6
    Registered User
    Join Date
    Jun 2003
    Posts
    9

    Re: Re: funny

    Originally posted by quzah
    You're in the wrong place. Go away.

    Quzah.
    well, i dun wana be rude with u , if u dun wana answer , just dun't answer , but i guess it is not ur own board to decide wether i should be here or go away

  7. #7
    Registered User
    Join Date
    Mar 2003
    Posts
    21
    now now children let's not be rude, hehe

    I like the guys idea, it'll funny to actually do that with code, your probably gonna need to get a phone network bible something with all the relevent codes etc... but I'm not too sure.

    you could get the last number phoned etc... then phone that?

  8. #8
    Registered User
    Join Date
    Jun 2003
    Posts
    13
    #define PH_NO_LENGTH
    int main()
    {
    char *ph_no;
    char responce;
    printf("Do u want to know ur ph no: "Y" or "N" ");
    scanf("%c", &responce);
    if(responce == 'Y' || responce == 'y')
    {
    printf("\nSee your telephone number on ur receiver and enter:");
    fgets(ph_no, PH_NO_LENGTH, stdin);
    printf("\nur phone no is:%s",ph_no);
    }

    else{
    printf("\nENJOY");
    }
    return 0;
    }


    Hey is it not a funny question....

    Thats what i understood from the qn... if there is any valid meaning.... pls edit ur qn...

  9. #9
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    1) You say you're making a trojin horse. That doesn't fly around here buddy. Read the board rules, and FAQ-off.

    2) The last code posted allocates no memory, yet scans into a pointer. This is a BadThing(TM).

    Quzah.
    Hope is the first step on the road to disappointment.

  10. #10
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >well, i wonder if u are insulting me by this
    Of course not, it's a valid answer to your question. Though the answer you want is far more complicated than you think.

    >well, i was trying to makle a trojan that will obtain the phone number then sending it to an e mail ??????
    In that case you'll get no help here. Use of a trojan such as this could be considered an illegal activity. The rules of these forums clearly state that illegal topics are not to be discussed. So, even those of us that know how to solve your problem won't give you any code to do it or describe the methods involved.
    My best code is written with the delete key.

  11. #11
    Registered User
    Join Date
    Jun 2003
    Posts
    9

    ok,

    hay man, that is why i have posted my message,
    my question was how to obtain the phone number from the local computer ?, that is is , i think it is legal now, that is what i was in need .

  12. #12
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    I don't care if you think it is legal or not, it stinks. End of thread.

    To the good guys and gals out there, remember, report dubious threads to the mods - we aim to keep the forums clean.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 06-03-2009, 09:55 PM
  2. adding a number to a number
    By bigmac(rexdale) in forum C Programming
    Replies: 11
    Last Post: 10-24-2007, 12:56 PM
  3. scanf oddities
    By robwhit in forum C Programming
    Replies: 5
    Last Post: 09-22-2007, 01:03 AM
  4. Issue w/ Guess My Number Program
    By mkylman in forum C++ Programming
    Replies: 5
    Last Post: 08-23-2007, 01:31 AM
  5. Random Number problem in number guessing game...
    By -leech- in forum Windows Programming
    Replies: 8
    Last Post: 01-15-2002, 05:00 PM