Search:

Type: Posts; User: KneeLess

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,086

    Yes, that's the problem, I wonder why that...

    Yes, that's the problem, I wonder why that happens.
  2. Replies
    5
    Views
    1,086

    Yes, I want to quote the string, so I broke what...

    Yes, I want to quote the string, so I broke what i was doing into parts.


    #include <stdio.h>
    #include <windows.h>

    int main(int argc, char **argv)
    {
    char str[1024];...
  3. Replies
    5
    Views
    1,086

    s(n)printf weird things happening...

    Running code like this, weird things happen:

    char SBD_FULL_PATH[1024];
    /* a ways down */
    printf("SFP1: %s\n",SBD_FULL_PATH);
    snprintf(SBD_FULL_PATH,sizeof(SBD_FULL_PATH),
    ...
  4. Replies
    1
    Views
    9,631

    inet_pton problems

    Using the following code to turn an ip address into a number, it doesn't output the correct numbers.

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <arpa/inet.h>
    #include...
  5. Replies
    5
    Views
    4,661

    StackOverflow, thanks for the nice tutorial, but...

    StackOverflow, thanks for the nice tutorial, but I'm positive I didn't overflow my boundries. Plus wouldn't allocating calloc to give me 4 chars overflow it the same if I changed nothing else?

    I...
  6. Replies
    5
    Views
    4,661

    Arrays out-of-bounds in functions only?

    Is it bad practice (and programming) to use plain arrays in functions not unlike this?

    char function(char *string)
    {
    char a[4]; /* Is this bad? */
    /* etc... */
    return a[whatever];
    }...
  7. Thread: Booleans in C

    by KneeLess
    Replies
    6
    Views
    3,262

    Booleans in C

    I need to find a way to do a C++ Booleans in C, the way I've come up with so far is:

    typedef enum { false, true } bool;
    bool one = false;
    Which works fine. But, I need to know if this takes up...
  8. Replies
    1
    Views
    3,529

    Kernel Module Programming in 2.6

    Hello. I'm trying to get into module programming, so I picked up both of the guides at the LDP. They were good guides, but for 2.4 or so I assume. I'm using 2.6 and whenever I insmod a module I...
  9. Replies
    3
    Views
    2,205

    This isn't a solution at all. For one, it's...

    This isn't a solution at all. For one, it's security by obscurity. Two, you can freely read the UID root from /etc/passwd. Three, if you restrict services to encrypted ones (like SSH) or tunnel them...
  10. Replies
    7
    Views
    2,302

    SQRT Mystery...

    I would like to know exactly how sqrt() works. Either in assembly or C, doesn't matter. What I need it for, is for my Controller on our schools robot. It doesn't have any sqrt function, and I would...
  11. Replies
    6
    Views
    2,504

    Nevermind, fixed. Don't you hate that? Worked on...

    Nevermind, fixed. Don't you hate that? Worked on it for 6 hours only to fix it in three minutes. :rolleyes:
  12. Replies
    6
    Views
    2,504

    Distance Formula Implecations: Urgent!

    Hello. As we all know, the distance formula is sqrt(sq(x2-x1) + sq(y2 - y1)). sq = square. Now, for some reason, this isn't at all working. Here is my code:



    float distance(float x2, float y2)...
  13. Replies
    4
    Views
    2,574

    But fstream has cout/cin. Your right, iostream...

    But fstream has cout/cin. Your right, iostream did work. But...nevermind, it works right?
  14. Replies
    10
    Views
    7,967

    Let's be nice to him. :) Now I have very...

    Let's be nice to him. :)

    Now I have very little knowledge of QBasic. Just enough for my QBasic class in school. :p. But I believe if you declare variables outside a SUB then it is global.

    Like...
  15. Replies
    7
    Views
    14,779

    But aren't we all? :p

    But aren't we all? :p
  16. Replies
    4
    Views
    2,574

    Some of the error messages: --'cout' :...

    Some of the error messages:

    --'cout' : undeclared identifier
    --'<<' : illegal, right operand has type 'char [51]'

    while(1)
    {
    cout << "Are you sure you want to encrypt this file (y/n)?...
  17. Replies
    4
    Views
    2,574

    *sigh* Using Namespace Std; Woes

    As suggested by Cat...

    I'm working on a simple XOR program (with some file i/o). It uses some include files. Here they are:


    #include <cstdlib>
    #include <fstream>
    #include <cstring>

    using...
  18. Replies
    20
    Views
    2,086

    Wow, I never knew that. Thanks Cat. Well it...

    Wow, I never knew that.

    Thanks Cat. Well it looks like this now


    #include <cstdlib>
    #include <fstream>
    #include <cstring>

    using namespace std;
  19. Replies
    20
    Views
    2,086

    Yes, it does. But whenever I use it in larger...

    Yes, it does.

    But whenever I use it in larger programs (more than one include), it throws errors at me..like this:


    #include <stdlib>
    #include <fstream>
    #include <string>

    using namespace...
  20. Replies
    20
    Views
    2,086

    Visual C++ 6 isn't good enough, what about Dev...

    Visual C++ 6 isn't good enough, what about Dev C++ 4? Yep, even Borland gives me the same error.
  21. Replies
    20
    Views
    2,086

    I still use .h. :p Only because when I use ...

    I still use .h. :p

    Only because when I use

    using namespace std;
    It says there is no namespace std.

    O_o
  22. Replies
    4
    Views
    1,139

    I believe I was treating them as text files...

    I believe I was treating them as text files unless I'm mistaken.


    fstream FileE(argv[1], ios::in | ios::out | ios::nocreate);

    Could I treat the text file as a binary file, and then...
  23. Thread: C++ Books

    by KneeLess
    Replies
    19
    Views
    2,562

    I've heard C++ Primer 3rd Edition...

    I've heard C++ Primer 3rd Edition is an awesome book. I'm getting it soon for myself.

    :)
  24. Replies
    4
    Views
    1,139

    XOR'ed *smacks head*, need help with it

    Let's say I have this code block right here:

    ch = ch ^ Password; // Encrypting...
    That encrypts my ch. Now would this decrypt my ch (back to normal)?

    ch = Password ^ ch; // Decrypting...
    ...
  25. Replies
    11
    Views
    2,177

    Re: File I/O question... please help!

    I don't really understand your question. You want to append data to the end, that is not touching the rest of the data, but you want the first line at the end? Huh?

    Well I think your problem is:
    ...
Results 1 to 25 of 42
Page 1 of 2 1 2