n*(n+1)'s Profile User Rating: -----

Reputation: 0 Apprentice
Active Posts:
28 (0.05 per day)
13-September 13
Profile Views:
Last Active:
User is offline Mar 04 2015 05:03 PM

Previous Fields

OS Preference:
Favorite Browser:
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
Icon   n*(n+1) has not set their status

Posts I've Made

  1. In Topic: Strtok & Null Checking

    Posted 2 Mar 2015

    Yes, I've read that. This is my understanding: The first call tokenizes the first string up to my delimiter ",". A null character replaces my comma. The second call tokenizes the string between the null pointer (beginning at \0) and the next delimiter (","). The third call does the same. This process repeats for the second and third lines. By the fourth line, the method begins returning null because it is not finding anymore delimiters. This is the reason many people use a while token != NULL to tokenize a string.

    The reason I asked about the code above is because it was in a sample provided by a Professor. If my understanding of strtok is correct, it shouldn't work. I was just wondering if I was missing something or is the approach incorrect?
  2. In Topic: Reading File to String with Stdin redirection

    Posted 6 Feb 2015

    Ahhhhhhh, I know what you mean now. I was confusing input/output redirection with passing command line parameters. You're the best!
  3. In Topic: Reading File to String with Stdin redirection

    Posted 6 Feb 2015

    Thanks for the reply, but it seems that the statement
     String filePath = console.nextLine();
    creates a string from the first line of the file being input. For instance, if input.txt's first line were "this is the first line", filePath would be "this is the first line". The remainder of the code would then create a file named "this is the first line." What I'm trying to do is create a file with input.txt. So I would need something that would be equivalent to
    Scanner file = new Scanner(new File("input.txt"));
    without the "input.txt." I'm not even sure if that's possible, I could be misunderstanding instructions.

    The actual instructions state that I should input two file names as command line parameters. The program should not prompt the user to enter file names. And the program should be run via the command line "java programName input1.txt, input2.txt."

    I was interpreting this as not hardcoding input names. Is that possible?
  4. In Topic: Push linked list pointer problem

    Posted 30 Jan 2015


    I thank you for your patience!
  5. In Topic: Push linked list pointer problem

    Posted 29 Jan 2015

    View PostSkydiver, on 29 January 2015 - 09:23 AM, said:

    View Postn*(n+1), on 28 January 2015 - 11:10 AM, said:

    Sorry for the multiple posts, I tried editing the previous but it wouldn't let me use a certain image extension. Then, I wasn't able to edit at all. But this site clearly explains what happens in memory when doing a push() function with JackOfAllTrades code: http://cslibrary.sta...dListBasics.pdf on page 15. It's called Correct Push() drawing.
    Can anyone explain with the same terms of that drawing, what was happening with what I was trying to do? Help is appreciated, I'm just trying to grasp what is going on.

    I hope this helps with your understanding...
    Attachment WrongPush.png

    This helps significantly. Thank you for the illustration. I was picturing head within WrongPushTest() pointing to the node containing one. Now I see how it works. Does the node containing one still exist after WrongPush() executes?

My Information

Member Title:
New D.I.C Head
Age Unknown
Birthday Unknown

Contact Information



n*(n+1) hasn't added any friends yet.


n*(n+1) has no profile comments yet. Why not say hello?