Help on a C program

This is a discussion on Help on a C program within the C Programming forums, part of the General Programming Boards category; I am kinda new to C and having a hard time trying to find a way to make this program. ...

  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    3

    Question Help on a C program

    I am kinda new to C and having a hard time trying to find a way to make this program. What I need the C to do is download an image from the internet (local) that will be a URL. When it has the image, it needs to save it somewhere. No photo manipulation.
    jpeg image.

    I have found things like MagickWand C API and libcurl, even WebClient which seems to be C#, but they are a bit over my head and over complicating what I need. Or maybe they are exactly what I need and I don't get it.

    So my question is does someone know a way to do this? Will I need one of these programs to help me or is it possible through other means?

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    C isn't Java. There aren't just simple standard functions that handle URLs for you. If you really want to do it yourself (without using one of the libraries you mentioned above), then you want to look into socket programming. Google Beej's Guide if you want to do it all by hand.


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

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Articus View Post
    I am kinda new to C and having a hard time trying to find a way to make this program. What I need the C to do is download an image from the internet (local) that will be a URL. When it has the image, it needs to save it somewhere. No photo manipulation.
    jpeg image.

    I have found things like MagickWand C API and libcurl, even WebClient which seems to be C#, but they are a bit over my head and over complicating what I need. Or maybe they are exactly what I need and I don't get it.

    So my question is does someone know a way to do this? Will I need one of these programs to help me or is it possible through other means?
    Is this on Windows or ????

  4. #4
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,649

  5. #5
    Registered User
    Join Date
    Mar 2011
    Posts
    3
    Yes, I have used socket programming on C before, but from what I can tell I need a port and an actual signal back from the 'server' (URL image)... which doesn't really seem right. You would have to explain in greater detail on server/client with a URL.

    Using Linux, probably Fedora.

    Looked that over, it says it is using C++... would that just work in C without any problems?

  6. #6
    Registered User
    Join Date
    Mar 2011
    Posts
    3
    Anyone else have any tips?

  7. #7
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 12:38 PM
  2. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 12:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 09:39 AM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21