OS: FreeBSD 5.2.1
X: 4.3.0_14
Hey, I'm having trouble diagnosing the issue I'm experiencing, could someone please point me in the right direction.
I'm trying to display the following...
Type: Posts; User: olbas
OS: FreeBSD 5.2.1
X: 4.3.0_14
Hey, I'm having trouble diagnosing the issue I'm experiencing, could someone please point me in the right direction.
I'm trying to display the following...
Assuming it's being ran in Windows, open up a shell, navigate to the directory you're saving the executeable in and run the program through that session.....
just to save typing the user input...
I'm having trouble with the code below. Basically copying s[i] into a int temp_one variable if it meets the criteria set in the loops found in expand. I was hoping that I could rely on the ASCII...
for(a=0;a<4;a++)
{
for(b=0;b<4;b++)
{
if((array[a][b]) != 0)
{
// if neighbour is anchor or active acquire and...
A very nice OS! Piece o' pie to run from floppy. got some very nice applications to, idea for learning ASM I would thing. Which I have to learn to a small degree due to stacks, so I think I might...
On the User CP/Edit signature page, the Smilies and tag strings are overlapping the cream(i think) box surrounding this text input box.
Ahh I get that now, (a >> b) right shifts the left-most 1-bit n places and returns the value. It doesn't shift all 1-bits.
This is why people use loops to feed test values and not just a single...
Instead of subtracting the current time from the past time, I used difftime(x,y), which gave me the same result, but seems alot smarter :)
Calling the program by time is more accurate than...
To go with what Prelude mentioned, I'm using bsd, so no win32 here.
Also, welcome :) Thanks for the alternate method though :)
Thanks to you both.
Firstly, Thantos thank you for the code, I chose a different method to calculate the seconds, for anything mroet han seconds, I could always choose to perform the mathematics...
Exercise 2-9 in the knr book asks for a rewrite of an example function, with my version being faster.
I have written one, and by code alone, I deem it faster.
My question is, how can I test the...
Exercise:
Given answer:
unsigned rightrot(unsigned x, unsigned n)
{
while (n > 0) {
if ((x & 1) == 1)
ok this drove me freakin insane, so i hope i can understand and implement this PITA.
x ^ (~(~0 << n) << p)
x = 1234 1234
n = 8
p = 16
~0 = FFFF FFFF
Step 1: (~0 << n) = FFFF FF00
Step...
There's a new method :) And it does seem more conveniant, and also more helpful with keeping each number base in my head.
sizeof and limits.h haven't been introduced yet, though I am familiar with...
Thanks for the last note, specifically because I was aware of it, though I was lazy with an explanation, never a good thing, so thanks for bringing this to my attention :)
In response to your...
Well, I struggled (still) with the task. I picked the answer off the site, and its below.
And I've been breaking it up to try and understand.
(~0 << (p+1))
complement any 0, and left shift...
You might find lint to be helpful when trying to work a bug out.
Directly from the man page:
By the time I'm done with lint, there's barely a reason to turn to gdb.
Isn't it better to use extra sets of curlies when using a multidimensional array. It helps you to keep track of which values are assigned to which array.
Example:
int New_Array[2][3] = { { 1,...
I see now! Thank you for answering such a lame question :) Appreciated.
/* getbits: get n bits from position p */
unsigned getbits(unsigned x, int p, int n)
{
return (x >> (p+1 -n)) & ~(0 << n);
}
This is the example in knr, which is what I have to presumeably...
Umm will it increase by 3204 each time?
Very helpful thread! Thanks for the added information.
Great explanation from Deckard!
</reincarnation>
I thought it should of done, but it just replaced every single letter, regardless of input. I've tried it again though (after another little rest) and it's working.
In regards to the website, I...
Heyyy, I'm on exercise 2-4 in k&r 2nd ed.
(Its getting kinda funky but I'm keeping with)
Ex: Write an alternate version of squeeze(s 1, s2) that deletes each character in s1 that matches any...
Learnt something new, ty. :)