Search:

Type: Posts; User: Tomwa

Search: Search took 0.01 seconds.

  1. Replies
    0
    Views
    626

    Graph Sortability

    So I've got a homework assignment in my University course that is giving me a lot of problems.

    Given a Directed Graph G we have to determine if the graph is sortable (Each vertex with indegree > 0...
  2. Thread: Help me

    by Tomwa
    Replies
    3
    Views
    944

    I'd also like to add the following C++ Tutorials....

    I'd also like to add the following C++ Tutorials.
    C++ Tutorial - Introduction to C++ - Cprogramming.com

    If Statements in C++ - Cprogramming.com

    For, While, and Do While Loops in C++ -...
  3. Replies
    5
    Views
    5,511

    1) No idea I've not had much practice with the...

    1) No idea I've not had much practice with the functions in the POSIX standard.

    2) Don't print the entire buffer? Print until a null terminator.

    write(fd,buffer,sizeof(char)*strlen(buffer));
  4. Replies
    4
    Views
    1,652

    Problems: 1) Change is incremented before it...

    Problems:

    1) Change is incremented before it is initialized
    int change = 0; when defining is necessary (or set it to 0 before using it at some point)

    2) Your final printf is using k instead...
  5. Thread: looping struct

    by Tomwa
    Replies
    19
    Views
    48,337

    Beat ya to it ;)

    Beat ya to it ;)
  6. Thread: looping struct

    by Tomwa
    Replies
    19
    Views
    48,337

    @chihwahli...

    @chihwahli

    I'm a little confused on your end goal here but I'll give it my best shot to answer what your asking.

    When you read memory all your doing is grabbing the appropriate number of bytes,...
  7. Replies
    4
    Views
    4,100

    You were almost there :) things just went a...

    You were almost there :) things just went a little screwy
  8. Replies
    4
    Views
    4,100

    1) fflush(stdin) is undefined behavior as fflush...

    1) fflush(stdin) is undefined behavior as fflush is meant to be used for output streams

    FAQ > Why fflush(stdin) is wrong - Cprogramming.com

    2) You're trying to store ints in your buffer...
  9. Replies
    12
    Views
    1,137

    The funny thing is I think Matticus meant to call...

    The funny thing is I think Matticus meant to call him out on him writing the code but ended up linking him to the working code instead
  10. Replies
    12
    Views
    1,137

    I'm pretty sure you just googled the answer for...

    I'm pretty sure you just googled the answer for him :wink:
  11. What purpose would there be in giving you code...

    What purpose would there be in giving you code for an interview? Even if we did give you the full and working code (Which isn't that hard) you'd never be able to perform the job. My guess is this...
  12. I love how hostile people are on here, you act as...

    I love how hostile people are on here, you act as though the OP said "Write me a program that gets the value of money from the number of coins" and I just did it, in reality a user posted his NEARLY...
  13. The best way to learn is through practice, I'm...

    The best way to learn is through practice, I'm glad you learned from this as that's without a doubt the best thing you could've gotten from posting on here. There are plenty of great tutorials on the...
  14. Replies
    17
    Views
    2,366

    Glad it helped, sorry my responses were so funky...

    Glad it helped, sorry my responses were so funky last night, I'm feeling (a little) better today after some rest :)
  15. @grumpy the largest part of your example tends to...

    @grumpy the largest part of your example tends to lean toward code which isn't properly factored and has the definitions extremely far from their usage (Ideally it wouldn't be more than a few lines)....
  16. Replies
    17
    Views
    2,366

    Honestly I think I'm losing it -.- I'm amazed...

    Honestly I think I'm losing it -.-
    I'm amazed I'm the first to catch that.
  17. Replies
    17
    Views
    2,366

    99% of that code is his, Technically he had a...

    99% of that code is his, Technically he had a working solution (Did the math and received input), and I improved on it by adding sscanf/fgets, the use of toupper to remove the need to compare to...
  18. The OP didn't specify whether or not he wanted to...

    The OP didn't specify whether or not he wanted to comply with any standard and as his original post contained getch I assume he accepts it as reasonable (Thought pointing out that it is non-standard...
  19. Ah you've got me there! It's still a good...

    Ah you've got me there! It's still a good practice though.

    I also want to point out that I accidentally dropped the getch() keeping the console window open so the OP needs to amend that into the...
  20. Replies
    17
    Views
    2,366

    #include #include #include...

    #include <stdio.h>
    #include <stdlib.h>
    #include <ctype.h>

    int main(void)
    {
    double num1 = 0;
    double num2 = 0;
    // Operand is a character not an array of characters.
    char...
  21. Replies
    17
    Views
    2,366

    Edit: sorry didn't expect 10 people to beat me to...

    Edit: sorry didn't expect 10 people to beat me to it -.-

    #include <stdio.h>
    #include <stdlib.h>

    int main(void)
    {
    double num1 = 0;
    double num2 = 0;
    // Operand is a character not...
  22. Your primary issues were: 1) Failed to...

    Your primary issues were:
    1) Failed to initialize your variables, when you create a variable memory is allocated for that variable by the operating system, there is however no guarantee that the...
Results 1 to 22 of 22