Thread: Data to location

  1. #1
    Registered User
    Join Date
    Jan 2021
    Posts
    30

    Data to location

    How do I send data to an IP address?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jan 2021
    Posts
    30
    The entire guide?

    and ty

    [Edited] I cant really find it out
    Last edited by oods1; 01-13-2021 at 01:03 PM.

  4. #4
    Registered User
    Join Date
    Jan 2021
    Posts
    30
    Code:
    info = inet_addr("33.333.333.338");
    (fake IP)

    I'm using this code, I was told I need a few codes before it for it to work

    Can anyone tell me the code
    Last edited by oods1; 01-13-2021 at 02:12 PM.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Sure, go and read the tutorial again (several times).

    This isn't some cake walk.
    Everything is hard work in C.

    Expect to spend a few days getting to grips with this, not a few hours.

    If you want to do something quick in 5 lines, use Python or something.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Jan 2021
    Posts
    30
    Quote Originally Posted by Salem View Post
    Sure, go and read the tutorial again (several times).

    This isn't some cake walk.
    Everything is hard work in C.

    Expect to spend a few days getting to grips with this, not a few hours.

    If you want to do something quick in 5 lines, use Python or something.
    where is the tutorial?

    [Edited] ive found it
    Last edited by oods1; 01-13-2021 at 03:57 PM.

  7. #7
    Registered User
    Join Date
    Dec 2017
    Posts
    1,626
    Data to location-facepalm-jpg
    A little inaccuracy saves tons of explanation. - H.H. Munro

  8. #8
    Registered User
    Join Date
    Jan 2021
    Posts
    30
    I have checked the entire tutorial, to send data to an IP address is not there.

  9. #9
    Registered User
    Join Date
    May 2012
    Location
    Arizona, USA
    Posts
    945
    Just a wild guess, but the "send() and recv()—Talk to me, baby!" section might have something to do with sending data to (and receiving data from) an IP address.

  10. #10
    Registered User
    Join Date
    Jan 2021
    Posts
    30
    Quote Originally Posted by christop View Post
    Just a wild guess, but the "send() and recv()—Talk to me, baby!" section might have something to do with sending data to (and receiving data from) an IP address.
    are we talking about the same tutorial?

    C Tutorial - Learn C - Cprogramming.com

    I got this but it don't work

    Code:
    send(int1 = inet_addr("33.333.333.333"));
    Last edited by oods1; 01-13-2021 at 05:10 PM.

  11. #11
    Registered User
    Join Date
    Dec 2017
    Posts
    1,626
    Data to location-doublefacepalm-jpg
    A little inaccuracy saves tons of explanation. - H.H. Munro

  12. #12
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    oods1, do you have a computer programming background, and are you familiar with the C programming language?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  13. #13
    Registered User
    Join Date
    Jan 2021
    Posts
    30
    Quote Originally Posted by laserlight View Post
    oods1, do you have a computer programming background, and are you familiar with the C programming language?
    I have done a bit of pascal back in college and I have only recently started C

    ^^

    so far, I find C amazing because variable can be assigned without declaring. If that's the correct way of saying it

  14. #14
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by oods1
    I find C amazing because variable can be assigned without declaring. If that's the correct way of saying it
    On the contrary, you do have to declare variables before assigning to them (or from them, for that matter).

    Anyway, the reason why john.c is facepalming so hard is that the tutorial that Salem was referring to was Beej's Guide to Network Programming. That will guide you towards understanding how to do the sort of network programming that you're looking to do.

    Having said that, since you obviously do not know C programming, the cprogramming.com tutorial on learning C is appropriate too, but of course it will not answer "How do I send data to an IP address?", but it will give you the tools so that you can use more successfully peruse the networking programming tutorial. Hence, it would be a good place to start, i.e., you're going to have to put your network programming ambitions on hold for awhile.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  15. #15
    Registered User
    Join Date
    Jan 2021
    Posts
    30
    Quote Originally Posted by laserlight View Post
    On the contrary, you do have to declare variables before assigning to them (or from them, for that matter).

    Anyway, the reason why john.c is facepalming so hard is that the tutorial that Salem was referring to was Beej's Guide to Network Programming. That will guide you towards understanding how to do the sort of network programming that you're looking to do.

    Having said that, since you obviously do not know C programming, the cprogramming.com tutorial on learning C is appropriate too, but of course it will not answer "How do I send data to an IP address?", but it will give you the tools so that you can use more successfully peruse the networking programming tutorial. Hence, it would be a good place to start, i.e., you're going to have to put your network programming ambitions on hold for awhile.
    so basically, start with the basics, got it. and ty

    ^^

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 12-08-2017, 08:44 AM
  2. Replies: 2
    Last Post: 08-28-2016, 02:24 PM
  3. Replies: 5
    Last Post: 05-02-2016, 08:47 PM
  4. Geo-Location
    By munna_dude in forum Tech Board
    Replies: 3
    Last Post: 05-24-2007, 05:15 AM
  5. FILE I/O. data written at wrong location.
    By epidemic in forum C++ Programming
    Replies: 5
    Last Post: 04-06-2007, 12:45 AM

Tags for this Thread