Hot answers tagged

1

Do you understand why you have to check for values over 255? You are doing it too late. A BYTE has 8 bits. That means the maximum value it can hold is 255. You are calculating the new value and storing it directly into image[i][j].rgbtRed for example. At that point, if the calculated value is > 255, it will be truncated when you assign it. So it's ...


1

Problems are here transaction_type = buy and here transaction_type = sell. buy and sell are functions, which is an invalid type to insert into the database. Perhaps you meant the string literals "buy" and "sell".


1

It's more important that you know how to locate seg faults. This is a very common defect and if you can't locate seg faults, you will be severely handicapped. There are two common ways. First, insert strategic unique printf statements. A seg fault will occur after the last executed printf and before the first non-executed printf. Just keep moving them ...


1

Your code node *checker = malloc(sizeof(node)); /* ... */ checker = hashtable[index]; means you allocate a new node, and then you throw away the only reference to that node, leaving this node as "definitely lost". There is no need to malloc in check. You copy pointers (memory addresses), not nodes. Same goes for the free, remove it, you might ...


1

Here's the pseudo code from the walkthrough: psuedocode: "recopy" method for each row      for n-1 times           write pixels, padding to outfile           send infile cursor back      write ...


1

Whole plaintext/ciphertext should not be in the else path, but after the loop. You want to do that only after ensuring that the whole key is alphabetic. You need to increment the index for the key string only after encrypting a character. Also, don't use isdigit and similar, use either the else path of previous isalpha, or if with !isalpha, catches them ...


Only top voted, non community-wiki answers of a minimum length are eligible