Thread: beginner help

  1. #1
    Registered User blacksaibot's Avatar
    Join Date
    Dec 2007
    Posts
    7

    beginner help

    I am fairly familiar with java, but I want to try my hand at C++, but going backwaords is a bit difficult for me.

    How do I create a program to read data from a file and copies it to another file?
    Also, how do I create child processes from your main program recursively using fork( ) and exec( ) commands???


    Thanks for your help!

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    For I/O --> see site tutorials or find a decent tutorial on the web. Lots of them.
    About child processes - what in the name of the abyss are you trying to do? Launching child processes - and many of them - is something I (and other too, I would believe) would frown upon.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Quote Originally Posted by Elysia View Post
    About child processes - what in the name of the abyss are you trying to do? Launching child processes - and many of them - is something I (and other too, I would believe) would frown upon.
    The families of fork() and exec() are frowned upon by you?

    Creating many child processes for no reason is indeed something to frown upon, however, there is a purpose for parent and child processes.

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Creating lots of child processes is what I frown upon. Especially when they do something that's to be done by the program - when you can actually do that code inside the program.
    Recursively spawn new processes? That I frown upon.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by blacksaibot View Post
    I am fairly familiar with java, but I want to try my hand at C++, but going backwaords is a bit difficult for me.
    I'm not sure I'd describe a move from Java to C++ as "going backwards."

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    I'm not sure I'd describe a move from Java to C++ as "going backwards."
    Well, lexicographically speaking...
    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

  7. #7
    Registered User blacksaibot's Avatar
    Join Date
    Dec 2007
    Posts
    7
    Thanks for so much help!!!!!

    I honestly could care less if you frown upon it! If there is something I want to do and I ask how, I don't see why you won't answer the question!
    If the tutorials online helped me, I wouldn't have bothered signing up on a forum.

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Yes, yes, yes...
    If you have a question, then ask it. We aren't here to build programs for you. This site has excellent tutorials for I/O.
    And I specifically asked you what you wanted to do with that recursion, and even if I frown upon it, others might not. Others may still help.

    Elaborate. Read some tutorials on I/O and ask about what you're unsure. I'm sure you'll receive lots of help then.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Quote Originally Posted by blacksaibot View Post
    I honestly could care less if you frown upon it! If there is something I want to do and I ask how, I don't see why you won't answer the question!
    Perhaps you should learn to look at a situation from another viewpoint but your own.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  10. #10
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by blacksaibot View Post
    Thanks for so much help!!!!!

    I honestly could care less if you frown upon it! If there is something I want to do and I ask how, I don't see why you won't answer the question!
    If the tutorials online helped me, I wouldn't have bothered signing up on a forum.
    Guess what -- now you're REALLY not going to get any answers.

    Cheerio!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Same old beginner question...
    By Sharmz in forum C Programming
    Replies: 15
    Last Post: 08-04-2008, 11:48 AM
  2. What are some good beginner programs I shouold make?
    By oobootsy1 in forum C# Programming
    Replies: 6
    Last Post: 08-09-2005, 02:02 PM
  3. Books, Beginner, MustHave
    By Zeusbwr in forum C++ Programming
    Replies: 9
    Last Post: 10-25-2004, 05:14 PM
  4. Windows programming for beginner (Absolute beginner)
    By WDT in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2004, 11:21 AM