Search:

Type: Posts; User: workisnotfun

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,059

    Here is my current code but trying all the COM...

    Here is my current code but trying all the COM Ports from 1-9 seems to only return an error and I'm not sure what's going on.


    #include <string>#include <Windows.h>
    #include <conio.h>
    #include...
  2. Replies
    3
    Views
    1,059

    Checking which Com Ports are free

    Is the only way to see which Com Ports are open and available for use by polling each one?

    I am quite new to programming related to Com Ports and the original way I was going to tackle it was by...
  3. That makes sense. The physcannon class a...

    That makes sense.

    The physcannon class a function that uses its members but is NOT part of the crossbow class and I'm trying to incorporate in. Would you have a suggestion for how to do that?
    ...
  4. It's already been created yes but including the...

    It's already been created yes but including the physcannon cpp file causes errors related to overlapping #includes with the crossbow cpp file which results in many errors such as this one.
    ...
  5. What would be the best way to incorporate another class's function to your own class?

    For background, I am creating a mod for Half Life 2 and want to add one weapon's functionality to all the other weapons. I am editting a class CWeaponCrossbow where I want to add the functionality of...
  6. Replies
    2
    Views
    1,574

    i get some weird output when I do cat...

    i get some weird output when I do cat /var/log/messages | grep hello


    Sep 26 21:36:50 localhost kernel: [16462.322273] Modules linked in: hello_2(POF-) binfmt_misc fuse ebtable_nat bnep bluetooth...
  7. Replies
    2
    Views
    1,574

    What's wrong with my Kernel Mod!?!?!?!

    Inserting it gives the correct output in /var/log/messages/ but when I try to remove it, it KILLS it and makes it unremovable!!! This screws up a whole lot of other things like my start up sometimes...
  8. 24 bits is 2^24 where 2^10 is 1K and 2^20 is 1M...

    24 bits is 2^24 where 2^10 is 1K and 2^20 is 1M and 2^4 = 16.

    2^24 = 2^20 * 2^4 = 16M

    That's how I think it works but I feel like I am missing something or it doesn't seem right. My professor...
  9. Memory size conversion question. How can 3B = 24 -> 16 M

    I have 3B = 24 -> 16M in my CS notes and I am not sure how to interpret this.

    Is it 3B is 3 bytes which is 24 bits and that's 16M? I am confused because I thought 10B was 1K... I feel I am missing...
  10. Replies
    2
    Views
    1,670

    Best way to store an input string

    I'm extremely rusty at C but is this the best way to store an input string into a char*?


    int length = 100; //initial size

    char * name = malloc(length * sizeof(char)); //allocate mem for 100...
  11. Oh sorry forgot to specify. It's for windows....

    Oh sorry forgot to specify. It's for windows. I've actually used sleep in a bash script file and just checked that it can be used in c++. Thanks for the help I think that'll work well. :)
  12. Running a procedure repeatedly after a set time interval

    I have a certain piece of code that I want to run every 2 minutes. One of my ideas is to get the time and modules that with whatever number represents 2 minutes. Would this work? and is there a...
  13. Replies
    15
    Views
    1,909

    I was under the impression something like this...

    I was under the impression something like this happens


    int main()
    {
    foo();
    //j is out of scope and memory is deallocated
    }
  14. Replies
    15
    Views
    1,909

    Malloc and Memory deallocation question

    People say for every malloc you need a free to free the memory but if I malloc memory to a pointer then it goes out of scope (say your main function returns 0) without freeing that memory, won't the...
  15. Replies
    2
    Views
    781

    I also tried closing the file and reopening it...

    I also tried closing the file and reopening it with a separate variable but no good. I have no idea what's going on.
  16. Replies
    2
    Views
    781

    Proper use of seekg

    I am trying to change the position stream pointer for input to the beginning of a file using

    encodedfile.clear();
    encodedfile.seekg(0);

    but after printing out encodedfile.tellg()...
  17. Converting ASCII text into chars or strings.

    I am confused as to how ASCII text such as backspace and delete are represented in a file. Aren't these more of text altering commands? yet how are these ASCII text represented in a file?

    I am...
  18. hmm, when I think about it more, what I'm trying...

    hmm, when I think about it more, what I'm trying to do seems like bad programming practice.
  19. How to overload a class func with an outside func while in a the same class

    I have a class that has a method name the same as another method separate from the class and I am writing another class method in the class but want to call the outside method instead of the one in...
  20. the destructor is called right after the line...

    the destructor is called right after the line return result;(which is the correct information) but before it gets back to the main (in between the data is wiped by my destructor). I think it might be...
  21. Not sure how much is needed but here is...

    Not sure how much is needed but here is everything I've written so far.

    void main()
    {
    string number;
    cout << "Enter the first number\n";
    cin >> number;
    LongInt *firstnumber =...
  22. Beginner problem with returning objects, my destructor is called and copy destroyed

    I have a two LongInt objects of class LongInt that I made and one of the methods is to add 2 long ints. For some reason, right before my add method returns the resulting (separate) LongInt object, my...
  23. Replies
    4
    Views
    1,105

    Dam I think it might be something with my syntax...

    Dam I think it might be something with my syntax because I changed
    hp = (structnode*)(malloc(sizeof(structnode)));
    hp->location = graph[index].location; to

    node head;
    head.location =...
  24. Replies
    4
    Views
    1,105

    Can't figure out this subtle error

    struct node{
    string location;
    int gval;
    int fval;
    node *next;
    };


    struct node *hp;
    for(int i = 0; i<graph.size();i++)
  25. jesus....thank you =____=

    jesus....thank you =____=
Results 1 to 25 of 72
Page 1 of 3 1 2 3