Search:

Type: Posts; User: CtrlAltKick

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    2,496

    i found this code on the net a while ago. it was...

    i found this code on the net a while ago. it was originally in c++ but i changed it to c because i had never messed with c++ before. i also added a sort function and a main driver so i could play...
  2. Replies
    5
    Views
    5,650

    you have defined duplicate as returning int yet...

    you have defined duplicate as returning int yet you return nothing, so change int to void. also, the for loop within the duplicate function is dereferencing 0 through SIZE of the num array, but...
  3. Replies
    9
    Views
    1,547

    here's your problem: printf("X equals %f...

    here's your problem:




    printf("X equals %f and %f.\n",&e,&f);



    you're passing the address of e and f. you need to pass their values. remove the ampersand.
  4. Replies
    2
    Views
    1,317

    thanks for the info and the link to the alt...

    thanks for the info and the link to the alt malloc. ill have sit down with a cup of coffee and give it a look tomorrow... actually later today. it's 4 am here. i was thinking of allocing large blocks...
  5. Replies
    2
    Views
    1,317

    djgpp slow free()

    i use this function to destroy my tree:



    void DestroyTree(splay_t *root)
    {
    splay_t *tmp;

    while(root)
    {
  6. Replies
    5
    Views
    4,994

    from ftp://ftp.idsoftware.com/. its just the...

    from ftp://ftp.idsoftware.com/.
    its just the game source, though. they havent released the engine source yet.
  7. Replies
    5
    Views
    4,994

    bit level hacking?

    hey, hows it going?

    i ripped this from the quake 3 source:


    float Q_rsqrt( float number )
    {
    long i;
    float x2, y;
    const float threehalfs = 1.5F;
  8. Replies
    3
    Views
    1,848

    thanks for the reply. gxx --version gives me...

    thanks for the reply.

    gxx --version gives me gcc.exe (GCC) 3.1.
  9. Replies
    3
    Views
    1,848

    cin.getline() needs input twice

    heres the code:



    #include <iostream>
    #include <string>
    using namespace std;

    int main(void)
    {
  10. Replies
    11
    Views
    4,771

    yeah, kind of slow when compiled with djgpp. just...

    yeah, kind of slow when compiled with djgpp. just bring it up a notch if using msvc or something else.
  11. Replies
    11
    Views
    4,771

    asdf

    you could try this:



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

    void warning(char *string, int flash, long speed);
    void sleep(long milli);
  12. Replies
    45
    Views
    7,529

    asdf

    cant name just one, sorry.

    God Lives Underwater - From Your Mouth
    PPK - Resurrection
    Dirty Vegas - Days Go By(remixed by i dont know)
    Masada - All Systems Are Go
    Dark UFO - Particle...
  13. Replies
    10
    Views
    7,790

    id rather use fgets, too, but he already...

    id rather use fgets, too, but he already explained why he couldnt. fgets may limit the amout of chars stored in buf but it doesnt limit the amount of text echoed to the screen. :/
  14. Replies
    7
    Views
    1,545

    in function getTime(). could it be that you...

    in function getTime().

    could it be that you free time before you return it?
  15. Replies
    17
    Views
    2,973

    im not saying he should use that method to save...

    im not saying he should use that method to save 1000s of numbers into seperate vars. he was asking about pulling tokens from input using fscanf.

    here is his original question... again:



    hes...
  16. Replies
    17
    Views
    2,973

    ok, thats pretty much the same thing i posted...

    ok, thats pretty much the same thing i posted except i
    i used fgets, strtol, and getchar instead of fscanf and getch.

    you say you were showing him how to print out the numbers but his post wasnt...
  17. Replies
    17
    Views
    2,973

    besides, what does yours really do? if he wanted...

    besides, what does yours really do? if he wanted to store the numbers in an array of int, he could do something like this:



    #include <stdio.h>
    #include <stdlib.h> //for strtol()
    #include...
  18. Replies
    17
    Views
    2,973

    his original question was this: mine...

    his original question was this:



    mine answers that. yours does not. whether your code is more efficient than what i gave him doesnt really matter in this case.
  19. Replies
    17
    Views
    2,973

    you could try this: fscanf(file,"%d %*d...

    you could try this:




    fscanf(file,"%d %*d %d %*d %d", &a, &b, &c);



    the * will cause the input field to be skipped and no assignment will be made.
  20. Replies
    6
    Views
    1,058

    if s1 is less that s2, strcmp will return a...

    if s1 is less that s2, strcmp will return a negative number. if they are equal, zero is returned. if s1 is greater than s2 strcmp will return a positive number.
  21. Thread: Array

    by CtrlAltKick
    Replies
    4
    Views
    1,085

    try this: int *getNum(int *numAry) { ...

    try this:




    int *getNum(int *numAry)
    {
    int i;

    for(i=0; i<TOT; i++)
  22. Replies
    3
    Views
    1,098

    p1 = nnn[0] will give you a pointer from int...

    p1 = nnn[0] will give you a pointer from int without a cast or differs in levels of blah blah blah warning. it depends on which compiler you use.

    nnn[0] is the value stored in that element of the...
  23. Replies
    2
    Views
    974

    ok, first read the line in with fgets. ...

    ok, first read the line in with fgets.



    #include <string.h> //for strlen()

    char line[1024];

    fgets(line, sizeof(line), stdin);
    line[strlen(line) - 1] = '\0'; //removes the '\n'
  24. Replies
    13
    Views
    17,538

    ok, whats hes done here is use variable...

    ok, whats hes done here is use variable formatting (not sure if thats the correct term). basically this line of code:

    printf("%.*s\n", len, &rotate[i]);

    says print len characters starting at...
  25. Replies
    13
    Views
    17,538

    clever :)

    clever :)
Results 1 to 25 of 31
Page 1 of 2 1 2