Search:

Type: Posts; User: DavT

Page 1 of 6 1 2 3 4

Search: Search took 0.01 seconds.

  1. 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. 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. 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...
  4. Thread: WiMAX project

    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. 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. 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. 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. 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. Replies
    6
    Views
    1,288

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

    if (i < 0) {
    i = -i;
    }
    ...or even...
    i = abs(i);
  10. 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...
  11. 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...
  12. Thread: popen help

    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...
  13. Thread: arrays

    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?
  17. Thread: I need help.

    by DavT
    Replies
    18
    Views
    1,546

    Yes.

    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. 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.
  20. Thread: xor Encryption

    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])
    {
    ...
  21. Thread: xor Encryption

    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.
    To answer your last question first:


    int nDecryptBit = (nKey & (1 << nBitNr)) >> nBitNr;
    /* can be written...
  22. Thread: using stdout

    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. 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. 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 2 3 4