see http://c-faq.com/ansi/constmismatch.html for a (fairly) full explanation
Type: Posts; User: DavT
see http://c-faq.com/ansi/constmismatch.html for a (fairly) full explanation
You are correct in thinking that you have caused an overflow (not a buffer overflow though)
q * i * j = 3.56 * 10 * 7 = 249.2 which will be a double. When you try and store that in a char, the...
If we ignore the current then your minimum turning circle will be of radius
r = speed / max_rate_of_turn
where r is in m, speed is in m/s and max_rate_of_turn is in rad/s
If the target is...
I agree with Dave_Sinkula that this is pretty simple. Basically a rectangular interleaver (which is what this is) can be though of as a matrix of, in your case, 16 rows and 8 columns.
The...
Ah, thought so... you use both scanf() and fgets() functions - don't do this in the same program - otherwise you get exactly this problem. If you are having trouble choosing between the two then...
well, AP[i][j]*temp.T[i][j] gives a result. You can't assign anything to a result. The C programming language will not solve equations for you, you have to do that yourself! To take a simpler...
The macro will return the u16 (probably an unsigned 16 bit integer) at memory location 0x4000130. The volatile keyword tells the compiler that the value may be changed by forces outside of the...
In your MultiplyaMatrix() function you are not initialising C before summing the individual elements:
void MultiplyaMatrix()
{
int i; int j;
int m;
for (i=0; i<RIGAA; i++) {
...
if (i < 0) {
i = -i;
}
...or even...
i = abs(i);
The reason your code doesn't recognise when the user enters 'd' is that the readStr() function is doing exactly what it says it does. It reads the longest null-terminated string it can fit into the...
Um... where to start...
initVlakList() creates a VlakList and two Vlaks (which are uninitialised) and makes these the first and last items in the VlakList. Basically that is your mistake. When you...
Its quite hard from your code to work out what you are trying to acheive, but I think your problem is in the value that you pass to use_info(). You are passing the first character in the string...
Hint: Take a look at the functions strspn() and strlen()...
edit: sorry, I just noticed that you are looking at arrays of ints so you can't use these useful string functions. The pseudo code you...
The main problem I see with your code is that you are using fread() on a text file - this will give you the wrong output 'cos that function is meant for reading in binary data. I would recommend...
ok. First off the break is in the wrong place. the switch(ch1) is still part of case 'A' so the break (which tells the computer that case 'A' is now finished) should come afterwards. You were also...
Could you post your code? Otherwise we'll just be guessing. An datking a stab in the dark, you did put the break in the line directly above "case'b'" didn't you?
Yes.
One quick fix to solve your 'interfering' issue is that you have missed the 'break' at the end of case 'A'. You also should really break after the default case - more of a style thing really.
Once...
You've been told before... use code tags.
This has to be your homework. Make an effort.
The way to see if you are close is to try it out. I used this short program to test out your encoder:
#include <stdlib.h>
#include <stdio.h>
void decrypt (unsigned char buf[37])
{
...
This is a fairly badly coded function that performs a fairly bad encryption scheme.
To answer your last question first:
int nDecryptBit = (nKey & (1 << nBitNr)) >> nBitNr;
/* can be written...
You can use:
printf("result\n");
fprintf(stdout, "result\n");
puts("result");
fputs("result", stdout);
obviously the printf functions are useful if you want formatting etc.
notice that...
Take a look here: http://www.math.niu.edu/~rusin/papers/uses-math/music/frequencies for a list of frequencies mapped to notes for standard (440Hz) tuning. The rest of the site is quite a good insight...
I wish I could help you - but I don't want to (to paraphrase my favourite Friends quote)
This is exactly why this is bad code. It only worked before because of a fluke in the way the compiler works. The moral of the story - write code properly.