Search:

Type: Posts; User: advancedk

Search: Search took 0.00 seconds.

  1. Sorting a set of numbers.... I should remember this....

    Hi

    Sorry for such a trivial question (this has to come up in the first semester of any comp-sci course), but I need to sort a string of numbers, no longer than 32 digits each, in "dictionary...
  2. Replies
    2
    Views
    2,013

    Quick check on reading in + using strings

    Hi

    I've been writing some C programs with the scanf funciton and wondered if there was an easier way to input data. I need functions which can:

    1. Identify set areas in strings (e.g. is the...
  3. Taking brackets into account for calculator input

    Hi

    I'm doing question 2 from http://olympiad.org.uk/papers/2006/bio/bio06-exam.pdf (Out of personal interest)

    How can I write a program that can handle the brackets? I suppose a more general...
  4. Replies
    5
    Views
    1,664

    What's a stack?

    Ok . . . I'm learning to program in C. I've been reading books/articles which have mentioned the "stack" or "call stack". However, I have no idea what a stack is. . . . wikipedia is too...
  5. Replies
    1
    Views
    1,803

    Using the parallel port in C

    Hi

    I haven't connected much hardware to my PC before, so I thought it would be interesting to do so. I want to use my parallel port to input and output data, possibly doing something like this:
    ...
  6. How to time how long a program takes to run?

    Hi

    I have written a C program that is supposed to run in under 2 seconds. Is there a function in C that lets me time how long it takes to run the program?

    Thanks
  7. Replies
    6
    Views
    1,907

    Writing C code in VS2005

    Hi

    I have visual studio 2005 and have been writing C code in it. However, I have done this in a rather round-about way. I created an empty c++ project, added a .cpp code file, wrote normal C into...
  8. Can I easily write multi-core programs in C?

    Hi

    I was wondering whether it was easy in C to write a program to take advantage of two cpu cores.

    For example, if I wanted to make a program that found out what every number from 0-100 dived...
  9. Hmm - I like tabstop's idea I don't get why...

    Hmm - I like tabstop's idea

    I don't get why you changed 567 to 456 - "the original four was thrown away, and five became four, six became five, and seven became six"? Without doing this I get the...
  10. Yes but I only want to have an array 5040 ints...

    Yes but I only want to have an array 5040 ints long and I don't want to have to serach through the array each time to find the sequqnce I am looking for.

    It's easy to store the sequences in a 5040...
  11. How can I make a hash table for my sequences?

    Hi

    I have the numbers 1,2,3,4,5,6 and 7 and can arrange them in any order. Thus there are 7! ways to do this meaning 5040 possibilites.

    I have a program that works out whether to assign a 1 or...
  12. Replies
    2
    Views
    1,548

    How to enter a line of data in C?

    Hi

    I have the code


    printf("Enter the characters:\n");
    char enc_numbers[10]; //Read in characters
    gets(enc_numbers);
  13. Replies
    1
    Views
    2,094

    Can I improve my code?

    Hi

    I made a program to answer question 1 from this paper

    http://www.olympiad.org.uk/papers/2008/bio/round_one.html

    I used a "sieve of eratosthenes". Just wondering if there was anything that...
  14. Replies
    29
    Views
    3,435

    Cool So when you have *(int *) at the...

    Cool

    So when you have


    *(int *)

    at the beginning of the code what is the (int*) bit doing? Does the * bit at the very biginning just mean "print out the value at the memory location...
  15. Replies
    29
    Views
    3,435

    C arrays and pointers etc. Help!

    I have the code



    int k = 2;
    int a[10];
    int b = 0;

    for(b=0;b<10;b++)
    {
Results 1 to 15 of 15