2,898 Posted Topics

Member Avatar for Carpetfizz

Welcome! > I've learned most of what I know from YouTube tutorials and some books. Ditch the youtube tutorials, and make sure your [book(s) is good](http://www.daniweb.com/software-development/cpp/threads/70096/c-books). People who took the time to write a good quality book usually took the time to make their explanations clear and their approach suitable …

Member Avatar for Carpetfizz
0
315
Member Avatar for triumphost

It is extremely hard to have any clear idea about what the actual problem is when all there is is a few fragments of incomprehensible code. Could you create a small test setup that reproduces the error? Like two very small DLLs with only the bare minimum functions to show …

Member Avatar for triumphost
0
955
Member Avatar for lxXTaCoXxl

> So I figured I'd post it for others, even though a lot of the programmers probably already have this list. Well, I guess I didn't have that list... I think that I will now add it to my list of horrible things that **YOU SHOULD NOT DO** with MACROs.

Member Avatar for sepp2k
-4
271
Member Avatar for triumphost

First things to verify: - Are all your exported functions marked as having `__stdcall` as a calling convention? - Are all your exported functions (or your whole code) marked with `extern "C"`? If both answers are not "yes", then fix that before trying anything else. > Now the above will …

Member Avatar for triumphost
0
527
Member Avatar for Labdabeta

The 3D case is no different than the 2D case, you just have a lot more cases to worry about. What have you tried?

Member Avatar for Labdabeta
0
666
Member Avatar for triumphost

The problem here is that when you add a number to a pointer, it moves the pointer by that number of objects that the pointer points to, not by that number of bytes. Say you have `float* ptr;`, then `*(ptr + 4)` is equivalent to `ptr[4]`, meaning that it gets …

Member Avatar for triumphost
0
312
Member Avatar for triumphost

The last row should always be (0, 0, 0, 1). That's just the way it is. Look up [homogeneous transformations](http://en.wikipedia.org/wiki/Affine_transformation#Representation) (or Affine Transformations). The last row is there just so that a straight matrix-vector multiplication can be used, as opposed to a special function just for that type of matrix.

Member Avatar for mike_2000_17
0
161
Member Avatar for mochiboo5

You can use the [`is_open()`](http://www.cplusplus.com/reference/iostream/ifstream/is_open/) function on the ifstream. As so: #include<iostream> #include<fstream.h> #include<string> using namespace std; int main() { ifstream inFile; string inFileName; cout << "Enter a filename: "; cin >> inFileName; inFile.open(inFileName.c_str()); if( ! inFile.is_open() ) { cout << "File could not be opened!" << endl; } else …

Member Avatar for Karkalash
0
277
Member Avatar for shsh111

I believe that "biological computer" refers to [DNA Computing](http://en.wikipedia.org/wiki/DNA_computing). I heard about this years ago in the midst of the whole "quantum computing" hype, I don't know how much has been done about it now. The basic idea is to use DNA (or RNA) as storage instead of typical NAND …

Member Avatar for mike_2000_17
-1
116
Member Avatar for macla

The first thing you should try is to use a memory-mapped file. Depending on what is in your file, you might have to copy it first. So, you create a memory-mapped file, and "load" the content of your big file into that "memory", which, in actually, will have the effect …

Member Avatar for WaltP
0
472
Member Avatar for Andrei15193

They are basically competing products. When I talk from a language-theoretic point of view, they are very difficult to distinguish at all. The same goes for application domains, generally speaking, they target similar domains, in a very similar way. So, just as a general opinion, I would say that Java …

Member Avatar for Andrei15193
0
200
Member Avatar for Hani1991

Let me retort a bit here. The point of view you expressed is exactly what I've always understood the Muslim's view-point to be and how I have perceived my muslim friends, but that's bad, and that's the problem, and thinking that this point of view is OK is even worse. …

Member Avatar for Reverend Jim
-5
1K
Member Avatar for Vasthor

Just an additional hint, you don't need to sort the elements to do the removal as asked in the exercise question. Read the question again and see if you can't find a better way to do it, without having to sort the elements. Remember, sorting takes O(N logN) time to …

Member Avatar for Vasthor
0
273
Member Avatar for capton

First, try to just hold down the F8 key as you boot (before the windows bootloader), and that should get you into the windows bootloader, and you should at least be able to boot windows in safe mode and then do the change to make the timeout higher than 0! …

Member Avatar for capton
0
247
Member Avatar for love_you_4rever

Step 1: Look at [operator precedence and associativity rules in C++](http://en.cppreference.com/w/cpp/language/operator_precedence). Step 2: Add parenthese in the expressions to mark the precedence more clearly. Step 3: Determine which expressions are valid and which are not. Hint 1: The thing at the left of an assignment `=` must always be a …

Member Avatar for love_you_4rever
0
100
Member Avatar for Helianthus

How can you be thorn between ASP and C++? Two completely different languages with completely different application areas. What appears clearest to me is that you don't seem to have a good about what you want and what area you want to get into. Once you determine that, your choices …

Member Avatar for phorce
0
291
Member Avatar for Reverend Jim

> > Is it your belief that the more handguns that are in circulation the safer everyone is? > > Absolutely yes. "For every time a gun in the home was used in a self-defense or legally justifiable shooting, there were four unintentional shootings, seven criminal assaults or homicides, and …

Member Avatar for Reverend Jim
1
394
Member Avatar for XodoX

There is a wiki-site maintained by a Daniweb member (daviddoria) and to which I contributed a few examples. It sounds like exactly what you are looking for: http://programmingexamples.net/wiki/Main_Page (it also includes examples in other languages, but the main one is C++, and you can also check out the Boost library …

Member Avatar for rubberman
0
232
Member Avatar for lewashby

If you leave the SSHD plugged into the same slot as your original HDD was plugged into, then you probably won't have to change anything. When you get the other SATA wire, you just plug your HDD into the second slot. If there is any trouble, just go into the …

Member Avatar for mike_2000_17
1
118
Member Avatar for snesnerd

I guess the idea of your code is to sort the row elements and then pick the middle one as the median. However, your code is full of mistakes. The strategy is not optimal, but it should work, start by fixing all the little mistakes in the code, and it …

Member Avatar for mike_2000_17
0
2K
Member Avatar for np complete

You have to use an external library for this purpose. The "built-in" functions of C++ are limited by design (to make it portable to any system easily). A good library for image manipulation is [OpenCV](http://opencv.willowgarage.com/wiki/) (which is only Mac / Linux, as far as I know, EDIT: apparently they have …

Member Avatar for mike_2000_17
0
254
Member Avatar for kirenemook12

A simple robot like this (two wheels, differential steering, with some proximity sensors and possibly something else like a camera) is usually controlled with a [microcontroller](http://en.wikipedia.org/wiki/Microcontroller). Microcontrollers range from very simple to a smart-phone level of capabilities. For very simple microcontrollers (uCs), they can be bought for as little as …

Member Avatar for mike_2000_17
0
274
Member Avatar for Stuugie

@Stuugie: These kinds of scammers don't bombard you with malware. They smooth-talk you for a while and then ask for money with a pretext like buying a plane ticket to come and meet you or something like that.

Member Avatar for Mike Askew
0
468
Member Avatar for lewashby

I'm not sure, but typically the "mnt" folder on most linux distributions is only for mounting temporary devices (like USB sticks). I wouldn't be surprised if there was some kind of automatic cleanup of that folder when starting up or shutting down the computer. That might be why it disappears. …

Member Avatar for lewashby
0
108
Member Avatar for sillyboy
Member Avatar for Helianthus
0
5K
Member Avatar for cynusalisa

This is a dangerous question, things can easily escalate into a flame war. It is very difficult to answer this question without knowing the specific kinds of differences you want to know about. There are countless technical and application differences between the two languages. You should probably start by reading …

Member Avatar for rubberman
-1
234
Member Avatar for AngelOfRock
Re: Hi

Hi, and welcome! You just started a thread, so you definitely can do that. I think you might not yet be allowed to post a code-snippet, if that is what you wanted to do and were denied permission (I think the requirement is 10 posts). Just post it as a …

Member Avatar for extr3mex
0
165
Member Avatar for lil_bit

Thanks for the nice poem! Woot Woot! Being human is hard, I'm still learning... > One thing I noticed is many people are 'speaking in code' I sometimes find code easier to understand than "human language". Might have something to do with being dyslexic. I try to be nice to …

Member Avatar for Reverend Jim
1
207
Member Avatar for Reverend Jim

Well, the [recently active members](http://www.daniweb.com/stats/members) page does show the geographical locations, but I think it not being updated properly, I still show up as being in Finland, which is where I lived when I first registered a couple of years back. I've been in Montreal ever since. I guess it …

Member Avatar for Dani
0
180
Member Avatar for rithish

The main tool for being able to reuse the same piece of code in different contexts is the ability to treat an object as an abstract entity (with some predefined set of functionality), which is what polymorphism means. This really boils down to being flexible about the types of the …

Member Avatar for mike_2000_17
-1
90
Member Avatar for triumphost

Have you looked into [Vertex Buffer Objects (VBOs)](http://www.opengl.org/wiki/Vertex_Buffer_Object). The glVertexPointer mechanism is older, before the time where it would be possible to transfer the vertices to the graphics card (in those days, you could barely store all the needed textures on the graphics card memory).

Member Avatar for triumphost
0
214
Member Avatar for myk45

Do you have to use VC++? That's the main question. Because if you can use MinGW/GCC, then there is no problem at all because it includes a make.exe program that you can use to build your project. Of course, you'll still have to worry about all the external dependencies, making …

Member Avatar for myk45
0
220
Member Avatar for VernonDozier

You cannot do what you are trying to do because objects in C++ are not references, they are objects. When you create the `outs` object in main(), you create an object, not a reference to another object, so you cannot "re-seat" it by making it refer to something else (in …

Member Avatar for VernonDozier
0
8K
Member Avatar for Suzie999

Whenever you see code being repeated over and over, a light should come up saying: "I could probably use a loop for this!". For starter, you could easily condense your function into a single set of nested for-loops, as so: void testFunc00(uchar * in, int len, uchar ** out) { …

Member Avatar for Suzie999
0
1K
Member Avatar for soapyillusion

Ubuntu is pretty good (personally I prefer Kubuntu, but it's a matter of taste). One issue is that you might have trouble finding a place to buy a computer without a Windows pre-installation. Some small computer stores that assemble custom computers might be one option, but be careful about what …

Member Avatar for soapyillusion
0
129
Member Avatar for Tinnin

Not only are you writing beyond the size of the array (i.e., because at the last iteration, `i == N` and thus, `i+1 == N+1`, and thus, the loop-expression becomes `u[N+1] = 3*u[N] + 4;`, and the one iteration before that (`i == N-1`) is also writing beyond the bounds …

Member Avatar for Tinnin
0
116
Member Avatar for Ararat

Instead of `if (*y == temp)` to test if the element was found, you need to use this test: if( y != a.end() ) Because if the element is not found, "y" will be equal to the end iterator, which means that it will be "not dereferencable".

Member Avatar for Ararat
0
1K
Member Avatar for HTMLperson5

> It is starting to become an annoyance, it makes daniweb more of a forum entirely devoted to Linux. I try to be neutral as much as I can. When I give instructions to people on installing a particular library or development tool or being able to link to it, …

Member Avatar for HTMLperson5
-3
461
Member Avatar for Suzie999

Simply strip away the path from the names you get from `GetModuleFilename` or `args[0]`. As in: #include <iostream> #include <string> #include <algorithm> int main(int argc, char** argv) { std::string full_name = argv[0]; std::cout << "Full name: " << full_name << std::endl; std::string exec_name(std::find(full_name.rbegin(), full_name.rend(), '\').base(), full_name.end()); std::cout << "Exec name: …

Member Avatar for Suzie999
0
313
Member Avatar for yardsalegarage
Member Avatar for Violet_82

1Gb would probably not be enough for using the ubuntu OS from the USB, it will be enough to put in on there and install ubuntu from the USB. I think that if you try to "try ubuntu" with a 1Gb live USB, your experience will be limited as you …

Member Avatar for Violet_82
0
230
Member Avatar for rdrahul809

And what exactly does a factorial or fibonacci calculation have to do with the problem you are asked to solve? Can you try to solve the problem that you are asked to solve?

Member Avatar for Schol-R-LEA
0
107
Member Avatar for Dani

The only use I see for the view count is when writing "articles" (not in the Daniweb sense) as opposed to asking questions. I was happy to see a large view counts on the couple of C++ tutorials I wrote, and I would assume it would be the same with …

Member Avatar for gerbil
0
206
Member Avatar for gerbil

These are the result of posts that got deleted by one of the moderators. Someone posts some spam or inappropriate post, it bumps up the thread, a lurking moderator reads it, deletes it, but then the thread remains bumped up. Unfortunately, this tends to happen to old threads too. As …

Member Avatar for deceptikon
0
137
Member Avatar for mike_2000_17

Hi, There is a bug with the editor that I noticed and others noticed too. When you post a very long code segment (or maybe just a long post, period), at some point it seems to overflow the capacity of the editor and you can no longer scroll all the …

Member Avatar for Dani
0
281
Member Avatar for apanimesh061

You simply install MinGW to any directory (like the recommended directory `C:\MinGW`). Then, you go into Dev-C++, into the global options "Compiler Options". There, you should be able to set up the directory in which to find the gcc compiler, set that to `C:\MinGW\bin` (or the equivalent). There are also …

Member Avatar for triumphost
0
2K
Member Avatar for Hazardous_Byte

Did you include the header `<algorithm>`? Normally, this should be resolved by overloading. And you might also want to remove the `using namespace std;` statement. This remove function that you are getting is [this one](http://www.cplusplus.com/reference/clibrary/cstdio/remove/) from cstdio. If you include the `<algorithm>` header, the overload resolution should be able to …

Member Avatar for Hazardous_Byte
0
711
Member Avatar for Sendy Hipo

To do the specialization, you must repeat the full declaration of the class for the special case, as so: // general template: template <typename T> class my_vector { private: T* data; std::size_t data_size; public: //... void set_element(std::size_t i, const T& value); }; // specialized template template <> class my_vector< char* …

Member Avatar for Sendy Hipo
0
155
Member Avatar for sandz24

The only compiler that currently supports "template aliases" (which is the name of this feature) is GCC version 4.7.0 and later (experimental). So, that's the compiler you need to install if you want that code to work. For Windows, MinGW has recently release a version with 4.7.0. As for Linux, …

Member Avatar for sepp2k
0
167
Member Avatar for Reverend Jim

I don't see anything confusing about it. When you write a code snippet there are clearly two sections when creating the post, a section for the text and one for the code. As for being able to also put code in the text section, well that can be useful for …

Member Avatar for Reverend Jim
0
257

The End.