# Search:

Type: Posts; User: DavT

Page 1 of 6 1

1. ## Thread: Why is there a warning??

by DavT
Replies
5
Views
998

### see http://c-faq.com/ansi/constmismatch.html for...

see http://c-faq.com/ansi/constmismatch.html for a (fairly) full explanation
2. ## Thread: mixed type / buffer over flow

by DavT
Replies
4
Views
811

### You are correct in thinking that you have caused...

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...
3. ## Thread: Mathematical, nautical steering problem

by DavT
Replies
6
Views
1,281

### If we ignore the current then your minimum...

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...

by DavT
Replies
5
Views
1,218

### I agree with Dave_Sinkula that this is pretty...

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...
5. ## Thread: Simple question (for you not for me!)

by DavT
Replies
35
Views
3,096

### Ah, thought so... you use both scanf() and...

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...
6. ## Thread: C Program Compilation in Linux

by DavT
Replies
1
Views
1,204

### well, AP[i][j]*temp.T[i][j] gives a result. You...

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...
7. ## Thread: what this macro do ?

by DavT
Replies
6
Views
1,102

### The macro will return the u16 (probably an...

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...
8. ## Thread: multiply 2 matrixes

by DavT
Replies
2
Views
1,646

### In your MultiplyaMatrix() function you are not...

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++) {
...
9. ## Thread: super fast question

by DavT
Replies
6
Views
1,288

### if (i < 0) { i = -i; } ...or even... i =...

if (i < 0) {
i = -i;
}
...or even...
i = abs(i);
10. ## Thread: Error "makes pointer from integer without a cast"

by DavT
Replies
7
Views
2,306

### The reason your code doesn't recognise when the...

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...

by DavT
Replies
3
Views
879

### Um... where to start... initVlakList() creates a...

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...

by DavT
Replies
2
Views
1,696

### Its quite hard from your code to work out what...

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...

by DavT
Replies
2
Views
769

### Hint: Take a look at the functions strspn() and...

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...
14. ## Thread: help w/ program

by DavT
Replies
16
Views
1,745

### The main problem I see with your code is that...

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...
15. ## Thread: I need help.

by DavT
Replies
18
Views
1,546

### ok. First off the break is in the wrong place....

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...
16. ## Thread: I need help.

by DavT
Replies
18
Views
1,546

### Could you post your code? Otherwise we'll just be...

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?

by DavT
Replies
18
Views
1,546

Yes.
18. ## Thread: I need help.

by DavT
Replies
18
Views
1,546

### One quick fix to solve your 'interfering' issue...

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...
19. ## Thread: plz explain a small function

by DavT
Replies
4
Views
1,215

### You've been told before... use code tags. This...

You've been told before... use code tags.
This has to be your homework. Make an effort.

by DavT
Replies
5
Views
1,743

### The way to see if you are close is to try it out....

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])
{
...

by DavT
Replies
5
Views
1,743

### This is a fairly badly coded function that...

This is a fairly badly coded function that performs a fairly bad encryption scheme.

int nDecryptBit = (nKey & (1 << nBitNr)) >> nBitNr;
/* can be written...

by DavT
Replies
4
Views
10,900

### You can use: printf("result\n");...

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...
23. ## Thread: C Sound codes

by DavT
Replies
4
Views
1,319

### Take a look here:...

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...
24. ## Thread: Don't know what to do

by DavT
Replies
13
Views
2,240

### I wish I could help you - but I don't want to (to...

I wish I could help you - but I don't want to (to paraphrase my favourite Friends quote)
25. ## Thread: return local variable

by DavT
Replies
17
Views
2,617

### This is exactly why this is bad code. It only...

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.
Results 1 to 25 of 143
Page 1 of 6 1