Search:

Type: Posts; User: usernamer; Keyword(s):

Search: Search took 0.14 seconds.

  1. Re: Getting a program to type into another program

    Thanks a lot, I'll look into that.
  2. Getting a program to type into another program

    I have a program, test, in which you need to enter the character 'y', followed by pressing <enter>.
    I have a second program which runs the program, test, in the terminal, but I'm having serious...
  3. Replies
    2
    Views
    363

    Struggling with apt-get

    Okay, I want to get a package so I can use the header ncurses when programming in c.
    I looked into it, and I need to get the package libncurses5-dev.

    I load the terminal and typed: 'sudo...
  4. Replies
    2
    Views
    836

    [ubuntu] Re: Creating man pages

    don't have time to look at it properly yet, but it looks like a great page. Thanks.
  5. Replies
    2
    Views
    836

    [ubuntu] Creating man pages

    Hi,

    I've just created my own program like cat, ls etc. and modified the .bashrc file in my home directory so I can just type a command (such as 'cat') to run it. In the spirit of things, I'd like...
  6. Replies
    11
    Views
    899

    Re: C++ noob question.

    tbh I'm a bit of a noob as well, and learning C as opposed to C++, so I could be wrong (but it sounds like the languages overlap here)...

    I'm fairly sure (that at least in C), *var refers to the...
  7. Replies
    6
    Views
    1,296

    Re: Book on Effecient C++ Programming

    I haven't read it, so don't know if this book is any good, but is free online, and looks like the kinda thing you're after, so you may want to check it out;...
  8. Re: C - assigment makes integer from pointer without a cast warning

    Excellent point. I've basically fixed my problem by reading up on pointers again (haven't done any C for a little while, so forgot some stuff), and doing:

    path[1] = *home;
    the code doesn't moan...
  9. [SOLVED] C - assigment makes integer from pointer without a cast warning

    I know it's a common error, and I've tried googling it, looked at a bunch of answers, but I still don't really get what to do in this situation....
    Here's the relevant code:


    #include <stdio.h>...
  10. Replies
    20
    Views
    1,997

    Re: [SOLVED] Why is C slower than Java?

    I'm sure it is generally, but with this example of a for loop and printing a number each time within that loop, it doesn't seem to be the case, which surprised me.
  11. Replies
    20
    Views
    1,997

    Re: [SOLVED] Why is C slower than Java?

    I did try to output the value of count in the for loop as well before (and again just now with optimisations enabled), and java was still around a second quicker.
  12. Replies
    20
    Views
    1,997

    Re: Why is C slower than Java?

    Thanks, I suspected it could be something roughly like that... I did originally have more 0's, but the java compiler complained at me :(
  13. Replies
    20
    Views
    1,997

    Re: Why is C slower than Java?

    Cheers for the input, but I doubt it since the printf is outside the for loop, and the C program once compiled takes around 3 seconds to print, and the java one takes around 1/10th of a second
  14. Replies
    20
    Views
    1,997

    [SOLVED] Why is C slower than Java?

    I was always told how C is faster than Java, so I decided to write a few very basic programs to see how much slower it is (if at all) at using basic commands like if, for etc. I compiled my code, and...
  15. Replies
    7
    Views
    562

    Re: fopen issues in C

    In that case I probably get it...

    <edit>
    for the record, I thought it might do what it seems to do, but would probably open hosts in a file you'd have to run, like your default text editor /...
  16. Replies
    7
    Views
    562

    Re: fopen issues in C

    Okay, makes sense... so I modified the path in my program to going from vim to /etc/hosts (and tried another file, '/home/pete/primestest.c' which is just a program I made some time ago in my home...
  17. Replies
    7
    Views
    562

    Re: fopen issues in C

    Cheers, no error code turns up now, but vim doesn't open when I run the program...
  18. Replies
    7
    Views
    562

    fopen issues in C

    I'm trying to work out how to use the fopen command in C, but I'm having some issues.
    I've written the following short program (and various similar ones for trying to open different files).

    ...
  19. Replies
    5
    Views
    681

    [SOLVED] Re: Using Grep in bash

    Worked nicely. Cheers.

    Also, as a side thing, is it possible to do what I was trying to do earlier somehow?

    i.e. do: grep [output of: sort -n pass.new pass.old | uniq -u] pass.new

    (so...
  20. Replies
    5
    Views
    681

    [SOLVED] Re: Using Grep in bash

    Two reasons, firstly the lines have to be in the same order for diff to print the lines in 1 which aren't in the other, (although in this case they were, but I'm also interested in a more general...
  21. Replies
    5
    Views
    681

    [SOLVED] Using Grep in bash

    Hi,

    I have two files (ASCII text), pass.old and pass.new, I want to find all the lines in pass.new which don't appear in pass.old (most lines overlap)... here's what I've got so far:

    sort -n...
  22. Replies
    5
    Views
    637

    [SOLVED] Re: confusion with terminal

    Thanks guys, I'd actually used ctrl C for stopping stuff (like infinite or just big loops) before, so surprised I hadn't tried that. Worked like a charm

    Big ty for the help.
  23. Replies
    5
    Views
    637

    [SOLVED] confusion with terminal

    When I use the terminal, lines generally start with:

    user@ubuntu:~$

    and you type in your commands etc. but sometimes this disappears and there's nothing at the start of each line (i.e. if you...
Results 1 to 23 of 23