Thanks a lot, I'll look into that.
Type: Posts; User: usernamer; Keyword(s):
Thanks a lot, I'll look into that.
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...
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...
don't have time to look at it properly yet, but it looks like a great page. Thanks.
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...
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...
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;...
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...
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>...
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.
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.
Thanks, I suspected it could be something roughly like that... I did originally have more 0's, but the java compiler complained at me :(
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
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...
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 /...
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...
Cheers, no error code turns up now, but vim doesn't open when I run the program...
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).
...
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...
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...
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...
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.
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...