1,288 Posted Topics
Re: > pass this string to my boolcheckpassc(char *) You don't have a function named boolcheckpassc that accepts a char-pointer. | |
Re: `int& num;` This mean "num is another name for something - it's some other object completely, and this is just another name for that other object". So what object is it another name for? `myclass(int number) : num(number){}` It's another name for this variable `number`, which exists for a very … | |
Re: Get above 500 chairs, and everyone sits in a chair. | |
Re: Your old programs are written in C++ from before 1998. Fifteen years. To fix them, I expect you need to learn how C++ standard library headers are named now (they do not have the `.h` on the end) and you need to learn about `namespace`. | |
Re: `delete` means "see this memory that I got using `new`? I don't need it anymore. Please run the appropriate destructor function and I don't care what you do with it after that." You can only `delete` memory that you got using `new`. You didn't get any memory using `new`, so … | |
Re: Good to know. Best of luck with it. ![]() | |
Re: Welcome to the board. The common language used here is English; you are speaking some kind of shorthand that is not very clear. It will help people to answer your questions if you use proper English, if you are able to. I think you're asking "How can I write a … | |
Re: You're not looking for the area centre of a rectangle, because only one of your examples is actually a rectangle. I think you're asking how to identify the point in a given four-sided shape that, when a line is drawn from that point to all corners, each of the four … | |
Re: It doesn't freeze. It just never makes a move. Add code to output lines telling you when it enters and leaves functions, and the values returned, and you'll see where the logic problem is. Welcome to debugging. | |
Re: This appears to be a question from "A First Book of C++", either written for the Indian market (or simply with whoever is setting the quesations swapping out a USD amoung for an INR value). Many people have asked these questions many times. If you just want answers, you can … | |
Re: It's a trade-off. DirectX is harder to use and does a lot less for you, requiring you to have more knowledge, time, etc. What you get is more control, which you can translate into more closely making it do what you want, with higher performance. > Isn't there an easier … | |
Re: You say "a linked list is given", and a "pointer to a node which is to be deleted". Do you actually mean this; that you get the list in some way, AND the node to be deleted? If you have nothing but the node to be deleted, and it's the … | |
Re: You need to think of a way that you only look at each entry in the list once, and at the end of it know the answer, or at least can find it very quickly. How would you do this on paper? If I read out a list of words … | |
Re: What's your C experience? The way you ask the question suggests that this might be awfully difficult for you as a first project. | |
Re: ` unresolved external` means the linker can't find the function. Usually, this means that you're not linking to the right libraries. It's not enough to tell the linker which directories to look in. You also have to tell it which actual library files to use. | |
Re: libcurl is a commonly used library to do that sort of thing. | |
Re: So let's have a look here... `int T,i,j,t,c,r[T],Jmax,Z,k; ` So j is an int, size undefined here (so it could be any value at all) at this point. I see you also make an array, `r`, which could be any size at all and there's no way to know. ` … | |
Re: Something like this might do it. collapsed theCollapsedobject; // Create the one to copy across data theOneYouWantToCopy; // Create the one to copy across theOneYouWantToCopy.collapsed = &theCollapsedobject; data* d_pointer_to_struct_on_device; // make a pointer that will point to the device memory cudaMalloc(&d_pointer_to_struct_on_device, sizeof(data); // allocate memory on device collapsed* d_pointer_to_collapsed_on_device; // … | |
Re: Read the error message. They usually give you really good clues as to what the problem is. If you're new to them, they can be a bit tricky to understand, so if you post it, we can walk you through it. Also, it's helpful to us if you make it … | |
Re: In turbo C++ 3.0, I've no idea. Could be anything. If you were using something a bit mroe modern, I'd point you at the C++ 11 threading library, or a standard third-party threading library like pthreads or the Win32 threading libraries. | |
Re: > When you compare a range such do you use && or do you use the or statement to compare them? You cannot compare ranges. You can only compare two objects at a time. You could write code yourself to compare, for example, two lowest nubmers and then two highest … | |
Re: An html file is plain text. std::ofstream FileOne("c:\\testfile.html"); This creates an empty html file. | |
Re: Here's a hint. http://en.wikipedia.org/wiki/Buffer_overflow | |
Re: Long story short, no. If you created your own class you could add an internal value to do it for you, but not with a plain primitive type like an int or a char. | |
Re: Long story short; none of them. That's why we have programming languages. | |
Re: There is no way to know the size of an array that has been passed to a function without also passing the size of the array. The best you can do is to know something special about the array; for example, maybe you make the first element the size of … | |
Re: Drawing on the screen is complicated. Let's go back a step. C++ doesn't know what a monitor is. It doesn't know about colours, or lines, or the keyboard, or what a mouse is, or anything like that. All that is handled by your operating system. If you want to draw … | |
Re: `for(j=65;j<=i;j++;count++)` Too much. Should have only three statements. | |
Re: Your loop does the following: 1/2 + 2/3 + 3/4 + 4/5 + .... | |
Re: OpenMP springs to mind, although it's not just for Linux. | |
Re: As an aside, this will fail if the file does not exist when an attempt is made to open it. Try specifying the open mode when you open it: ` fstream myFile ("C:/Test/C++FileRW/test.txt", std::ios::in | std::ios::out);` | |
Re: You're talking about a *loop*. Half way down: http://www.cplusplus.com/doc/tutorial/control/ | |
Re: This being C++, there are ways of doing whatever you're doing that are much easier for you to keep track of and think about. Does it have to be a 3D naked-array of 3D naked-arrays of 3D naked-arrays? If you're actually modellings a groups of *somethings*, each of which contains … | |
Re: Represent the image as a 2D array of pixels. Make a new blank 2D array of the same size. Flipping: For all width and all height, copy pixel[i, j] to newpixel[height-i, j] (remember to start counting at zero). Rotation is a similar simple transformation. This is programming. The art, craft … | |
Re: I struggle to think what you have done with your code if you are unable to use a function that has been written in a different cpp file. So long as the cpp file you want to use it in has seen the prototype of that function (which is usually … | |
Re: http://www.lmgtfy.com/?q=exception+handling+in+C%2B%2B | |
Re: > that allows the user to enter integer numbers. Can you do that bit? | |
Re: ` while ( (z != "F") || (z != "C") || (z != "Y") )` Can you give me a value of z for which this will not be true? Any value at all - give me one letter that will make the while loop stop. | |
Re: `void main(){` has never ever ever been correct. `int main(){` is. For your code to work, the executable needs to be in the same directory as the text file you're trying to open. Is it? How do you know? | |
Re: We don't do homework. Show us your code and ask us to help you with something you don't understand. | |
Re: `int *ptr;` means "create an int-pointer named ptr", `double *ptr; `means ""create a double-pointer named ptr", so `T *ptr;` means "create a T-pointer named ptr." The type `T` will be whatever type you actually use when you use this template. | |
Re: Storing them in a text file seems a bit of a pain. Why not create an `objects` class, and store them in , for example, a `vector<objects>`? | |
Re: We won't do your homework for you. How far have you got? Have you got this far yet? int main() { } What are you stuck on, or what do you not understand? | |
Re: Edit: Oop. Didn't notice Jason's post. | |
Re: `int primes[(limit/2)+1];` This is an array of 150 000 000 001 `int` values. If each int is four bytes, that's 600 000 000 004 bytes. That's a bit over 500 GB. I'm guessing you don't have 500 GB of memory. Similar issue with that array of `bool` you have. You … | |
The End.