For what kind of degree? Only Java?
At my university, Java is taught first, then C++; from there its the students job to learn other languages (besides obvious cases).
The point is: a...
Type: Posts; User: Lateralus
For what kind of degree? Only Java?
At my university, Java is taught first, then C++; from there its the students job to learn other languages (besides obvious cases).
The point is: a...
Maybe he is incrementing curtab before he should, because it is accessing the array of structs starting at index 1.
Or if you didn't want to use dynamic memory allocation:
int main(void) {
int data = 0;
struct node d;
d.count = data++; //assigns data to d.count, then increments data by 1
...
Yes, you don't need to look for programming references. This is a math topic more so than a programming one. A programming language is a tool used to implement mathematical concepts.
I am working on a project for a C++ class. We need to implement an abstract problem solver that can solve simple, yet different problems.
I am doing this by creating a 'rule' class for each...
A simple one would be strcmp().
if (strcmp(str1, str2) == 0) {
// password is correct
}
Read the man page for strcmp for full details, but it will return 0 if the strings are the same.
The following shows a basic way I have used it. Any code within the if block is the child process. It is good to take in multiple connections in a client/server app.
pid_t child;
.......
...
I don't know if this is gonna help but recently (in unix) I used read() on a file descriptor. Then if it returned an error, and errno was EISDIR (or something like that, then I knew it was a...
I would try posting in a linux forum if that was the result. Cause your dealing with system calls here.
I would also check if the file descriptor is valid.
EDIT........
Actually try using...
Im not sure how it would work with a serial port, but most likely, its a file descriptor. With that you can call stat (see man stat page) and then get a struct, which contains the size of the data...
Great question. I was just thinking about this myself the other day.
Thanks for the heads up. I'll look into everything you mentioned.
I just got to working code with my first program dealing with the unix file system. all it does is accept a command line path to a directory, and a path to the directory where the files will be...
What school is this from? Pretty nice. I go to RIT (rochester institute of technology) and we just got a new gym/training facility. It's a really big one like your picture. It's nice when you see all...
Yea, what Linux distro are you using? Most popular ones include gcc/g++. Simply type g++ into a terminal to see if its installed.
I got everything straight now. I am one of about six interns at this company, and we all sit in cubicles. The whole time I was trying to fix the problem this other intern kept talking, and talking,...
That did seem like the obvious way to do it, but I wanted to have the string copied to the memory I allocated, instead of pointing it to argv[1]. It just seemed like it would have worked better that...
Well, basically what I need to do is take a command line argument and store its value in a char * located in a struct.
int main(int argc, char *argv[])
{
// some other stuff
struct...
I am working with some Unix system calls, and I want to be able to open a directory, and perform read/write operations on the files in that directory.
I already know that I can open a directory,...
ahahaha, pocket protector +5....
Anyway if your looking to do sockets maybe you should look at Stevens UNIX Network Programming. It'll get you to where you wanna go with sockets.
ahahaha, and I just read through the whole thread until I read Salem's post and looked at the dates.
Now I want to upgrade it so that it can use different data types. I know I will have to cast values and use void pointers, but I am unsure how to go about this. Can someone point me to a detailed...
Yea, the nice thing about running into problems like this is that it is very unlikely that I won't consider precedence in the future. :D
Well, after taking a look around I solved the problem.
In order to use tree->root I needed to use: (*tree)->root;
Mods, you can delete this if you wish, or other can view it for reference.
If I have a function, such as a delete function for a binary search tree, and I want to change the root node, which is a pointer within main(), The only way I read I could do that would be to pass a...