- Strength to Increase Rep
- +9
- Strength to Decrease Rep
- -2
- Upvotes Received
- 73
- Posts with Upvotes
- 62
- Upvoting Members
- 38
- Downvotes Received
- 12
- Posts with Downvotes
- 12
- Downvoting Members
- 3
Re: I'm not really sure if I understand your problem, because as far as I can see you are already have all of the knowledge to solve it. Your question is how to pass the two matrices to the thread that is going to multiply them. And you say that you … | |
Re: Takes about a 2 second Google search... probably less: [url]http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html[/url] [url]http://www.boost.org/doc/libs/1_45_0/doc/html/thread.html[/url] | |
Re: webhost.com won't allow you to connect to the MYSQL database remotely. Try to ping the domain: C:\Users\thelamb>ping mysql9.000webhost.com Pinging mysql9.000webhost.com [10.0.0.23] with 32 bytes of data: 10.0.0.23 is the local ip on 000webhost.com where they run the mysql server. | |
Re: [code]if(data[j] == ayat)[/code] This comparison will only work if the user enters the exact string that is in the data array. This is not what the question asks, you need to come up with a way to compare parts of(the entire student ID, or part of the student name) the … | |
Re: i is generally used for loop counters.. but no one is forcing you. Specially if the body (the part between { and }) of the for loop is big, you might consider using a more meaningful name for the loop counter. There are a lot of 'naming conventions'.. each with … | |
Re: There is nothing wrong with this snippet (but yes, use dynamic_cast). Maybe you set the breakpoint wrong, You're saying something with a DLL and an EXE, so if the code of Main() is in the DLL, how did you set the breakpoint? You can try instead to show a MessageBox. | |
Re: How about instead we help you solve what is wrong with this code. Now, to do that.. we need to know what you mean with 'doesn't work when called'. This sentence alone is not very helpful: Does it crash? Does it just it give output, but not what you expect? … | |
Re: Naturally, you can have multiple connections to one port. Just think of an HTTP web server serving web pages to thousands of users connected on port 80. The way you distinguish between clients is by socket number. Now, you falsely assume that every time accept (or any WinSock functions) returns … | |
Re: When you return from main, your program is terminated, this also means that the console window will close. In Visual studio, if you execute your program by pressing 'Ctrl + F5' it will not immediately close, instead it will wait for you to press a key. In other situations, you … | |
Re: And now we have to guess what the problem is, right? Why don't you help us out and tell us what you're having problems with, ok? Makes things a lot easier for the people willing to spend time trying to help you. | |
| Re: Your question is impossible to answer. How am I suppose to give a value to how difficult it will be for you? All I know, from my own experience, is that for me it is easiest to learn a language by just starting to write a project in it. This … |
Re: [code=cpp] char* a[10]={"asd","QWE","ghj"} [/code] On this line, you are assigning const char* (everything between "'s) to a char* (elements of a). So when you try to modify something at a[1][1] you are trying to modify a const char* indirectly. Because this constant data ("asd", "QWE", etc.) is stored in a … | |
Re: There is a big OS development community here: [url]http://forum.osdev.org/index.php[/url] with a wiki: [url]http://wiki.osdev.org/Main_Page[/url] Usually, hobby-OS projects are compiled with a GCC cross compiler. There is a document on the OSDev WIKI about how to set this up. In early stages, the kernel can not depend on anything from from libc … | |
Re: You can use (win)pcap to gather network data... it's probably a bit over-kill for your solution though. If you're doing this on Linux, why not make use of /dev/random? On Windows, why not use 'CryptGenRandom()'? If you somehow don't want this, I think easier randomness can be obtained from mouse … | |
Re: When you pass an array to a function, information about its size is lost (unless the function only takes arrays of a certain size, e.g. void foo( string arr[100] ); instead of void foo( string* arr ) or void foo string[] arr) ). Since this is a C++ forum, you're … | |
Re: _TCHAR is typedef'd as 'char' when your project uses 'ANSI' settings, it is typedef'd as 'WCHAR' when your project is unicode. wprintf is just like printf, but instead it takes a const WCHAR* as input, not a const char*. L before a string literal ("string") tells the compiler that this … | |
Re: Yes there is, e.g. in the 'singleton' pattern. Or when you have a global static class that holds objects that should be modifiable. Usually though, you are right that you don't want to do this. But returning a const& is very common, for example in getter functions. | |
Re: And now what? What is your question? Please don't say "it doesn't work". | |
Re: I'm not going to read your code, it is messy. In general, say you have two singly linked lists p and q. To link them together, you can simply make the last element in p point to the first element of q. In pseudocode: [code=cpp] LinkedList p,q; // traverse to … | |
Re: The problem is in these lines: [code=cpp] Point start, end; Point(double x, double y) { this->x = x; this->y = y; } [/code] Your Point class has one constructor, that takes two arguments. However, no where in the Ray class you tell it what the arguments should be. So the … | |
Re: I'm not sure if this is what you mean, if not, can you give an example what you're confused about? [code=cpp] struct base { virtual void test() {} }; struct derived : public base { void test() { } virtual void test2() { } }; int main() { derived* d … | |
Re: I suppose that is a debug assertion you're getting? You should also mention on which line (and don't put spaces in the code tag). Usually it means that you're accessing some_vector[size], but since the vector is indexed from [0...size-1] this is out of range. Without proper code tags your code … | |
Re: How about: [code=cpp] bar = foo[3]; [/code] ? | |
Re: Your comments are a bit excessive, I know this is something very personal but generally you'll want to have few comments that help understand the code, not comments that repeat what the code says. Don't take this too harshly though, I am really a comment-minimalist. E.g. [code] #include <iostream> // … | |
Re: Run the code under a debugger, then tell us on which line it segfault. If you run windows, you can use Visual Studio or whichever IDE you use. You can't really expect people to invest time into reading your code (or copy/pasting + compiling themselves), when you can easily pinpoint … | |
Re: You can add some 'type' variable to the base class, that you set through its constructor. [code=cpp] class base { enType type_; public: base( enType type ) : type_( type ) {} enType getType() const { return type_; } }; struct derive : public base derive() : base( TYPE_DERIVE_1 ) … | |
Re: If I remember right, partial template specialization is in the C++0x standard. I don't know if you can do it on one member function like you want though. Haven't looked into it yet as afaik it's not implemented yet in VS. Also, the enable_if stuff Mike mentioned is in C++0x, … | |
Re: Because 0+2+4+6+8+10+12+14+16+18+20 = 110? What do you think the output should be. | |
Re: Because what you're passing on line A is not a pointer to nVal, it is a pointer with value 65, and you are printing the value of the pointer. On line B you pass the address of nVal, so a pointer with value 2359119. So in the first case you … | |
Re: C++ programming language is more a reference book (at least that is how I use it). I don't know the first two books you read, but if they gave you a good basic understanding of C++ then I would try to start a project. This is the best way of … |