Search:

Type: Posts; User: Ariod

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Ah, I get it. Thanks a lot!

    Ah, I get it. Thanks a lot!
  2. It is an array of unsigned chars. Okay, now...

    It is an array of unsigned chars.

    Okay, now I'm so desparate I tried the simplest program possible:


    #include <stdio.h>

    int main(void) {
    FILE *f = fopen("test.txt", "r");
    unsigned char...
  3. Reading hex values from a text file - what am I doing wrong?

    Hey guys,

    I'm trying to read MAC addresses from the following text file:


    192.168.1.1 00:0c:41:ae:5a:04
    192.168.1.103 00:16:76:1d:4d:a9
    192.168.90.130 00:0C:29:F2:25:63...
  4. Generating 100k to 1 million unique random numbers

    Hey guys,
    I need your help. Do you have any advice on how to generate 100k to 1 million unique random numbers, relatively fast? I have an assignment to compare the times needed to search for a...
  5. Replies
    3
    Views
    2,090

    Shouldn't it be: O(1) < O(log(n)) < O(n)

    Shouldn't it be:

    O(1) < O(log(n)) < O(n) < O(nlog(n)) < O(n^2)... for large n's?

    Or am I missing something?


    And thanks for the input ILoveVectors but I already know that.
  6. Replies
    3
    Views
    2,090

    Worst-case complexity of this function?

    Hi,

    Could you tell me why the worst-case complexity of the sort() function is O(nlg(n))?



    struct s1 {
    long code;
    struct s1 *next;
    };
  7. Replies
    1
    Views
    2,584

    Searching a binary search tree - doesn't work

    Hello,

    I have a binary search tree consisting of nodes that contain first and last name of students on a college. Below I've written a function that receives student's last name, and should return...
  8. Replies
    1
    Views
    2,589

    Average asymptotic run time?

    Hi all,

    The following code is from one of the programming classes that I used to attend. This function recursively sums the elements in an array. They said that the a priori complexity of this...
  9. Thread: Functions, stack

    by Ariod
    Replies
    9
    Views
    1,704

    Thanks for the tip, I get no warnings now.

    Thanks for the tip, I get no warnings now.
  10. Thread: Functions, stack

    by Ariod
    Replies
    9
    Views
    1,704

    So the string (the actual text) is not stored on...

    So the string (the actual text) is not stored on the stack? Sorry, I'm just trying to understand this.



    I'm using Borland's free C/C++ compiler. The file's extension is .c if that means...
  11. Thread: Functions, stack

    by Ariod
    Replies
    9
    Views
    1,704

    Functions, stack

    Hi,

    I have the following code:




    #include <stdio.h>

    char * returnString () {
  12. Replies
    6
    Views
    1,299

    Don't yell, I didn't notice your post (look at...

    Don't yell, I didn't notice your post (look at the time mine was posted).

    Thanks though.
  13. Replies
    6
    Views
    1,299

    I realize they're bad, thanks, but I'm still...

    I realize they're bad, thanks, but I'm still getting that runtime error on the input for average score.
  14. Replies
    6
    Views
    1,299

    I'm getting a runtime error

    Hi,

    Could you please take a look at the following code? I'm getting a runtime error every time I enter the average score:




    struct blah {
    char firstname[20+1];
    char lastname[25+1];
  15. Replies
    16
    Views
    2,364

    What do you mean? Could you give an example? ...

    What do you mean? Could you give an example?

    Also, is this line necessary before fputc:




    fseek(f, 0, SEEK_CUR);
  16. Replies
    16
    Views
    2,364

    Help! Inserting a character into file

    Could you guys look at the following code?



    #include <stdio.h>
    #include <stdlib.h>

    int main() {

    FILE *f;
  17. Replies
    2
    Views
    1,287

    Why is fflush needed here?

    OK, this is a part of a program that I wrote:




    #include <stdio.h>
    #include <string.h>

    struct info {
  18. Replies
    1
    Views
    1,223

    Entering floating numbers

    Hi,

    I'm trying to write a little program that will help me calculate minority and majority carriers in semiconductors based on my input. The program should handle large numbers, typically around...
  19. Replies
    12
    Views
    10,534

    Thanks, you've been much helpful!!

    Thanks, you've been much helpful!!
  20. Replies
    12
    Views
    10,534

    What I'm actually trying to do is replace...

    What I'm actually trying to do is replace ampersands (&) in a HTML file with &amp;. So when the ampersand is found, the program would insert amp; after it.

    What you're suggesting is to define a large...
  21. Replies
    12
    Views
    10,534

    If I use the w mode, it will delete the contents...

    If I use the w mode, it will delete the contents of the file before writing.
  22. Replies
    12
    Views
    10,534

    Inserting text into a file

    Hi all,

    I'm having difficulties inserting a string into a text file. Here's my code:




    int main() {

    FILE *f;
  23. Replies
    2
    Views
    1,193

    "Press any key to continue"

    Hi,

    You know when you compile and run a program, it says "Press any key to continue" when it's finished running? Or back in DOS, when you list contents of a directory with the command dir /p?
    ...
  24. Thread: ScrollWindow()

    by Ariod
    Replies
    7
    Views
    21,255

    Thanks again Jason :)

    Thanks again Jason :)
  25. Thread: ScrollWindow()

    by Ariod
    Replies
    7
    Views
    21,255

    x - coordinates cxChar - average character width...

    x - coordinates
    cxChar - average character width
    iHorzPos - position of the horizontal scroll bar

    If client area is scrolled to the left, part of text is being drawn in the negative area of the...
Results 1 to 25 of 35
Page 1 of 2 1 2