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...
Type: Posts; User: workisnotfun
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...
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...
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?
...
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.
...
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...
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...
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...
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...
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...
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...
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. :)
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...
I was under the impression something like this happens
int main()
{
foo();
//j is out of scope and memory is deallocated
}
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...
I also tried closing the file and reopening it with a separate variable but no good. I have no idea what's going on.
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()...
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...
hmm, when I think about it more, what I'm trying to do seems like bad programming practice.
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...
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...
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 =...
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...
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 =...
struct node{
string location;
int gval;
int fval;
node *next;
};
struct node *hp;
for(int i = 0; i<graph.size();i++)
jesus....thank you =____=