1,288 Posted Topics
Re: [QUOTE]after deleteing I want to show the array contents[/QUOTE] As Jonsca said, that is the problem. Show the array contents, [I]then[/I] delete the array. | |
Re: Good guess; a [B]char[/B] is a single character, though. If you want to enter more than one character, you'll need a [B]std::string[/B], or an array of [B]char[/B]s. I'm a bit lost with this: [B]char (Jeanne);[/B] What is that for? You have created an object of [B]char[/B] type, named Jeanne, and … | |
Re: [B]return main();[/B] looks like an attempt to loop. Unfortunately, it will simply keep calling main() until the whole thing runs out of memory. Calling the main function again is a very bad way to perpetually loop. Try instead wrapping the whole loop in [CODE]while (1) { // your forever looping … | |
Re: This might be what you're looking for; [url]http://www.cplusplus.com/reference/iostream/ios_base/width/[/url] You can set the width of an output field with it. In the example on that page, note that after setting the wdith to 10, the output ("100" in the example) then takes up the 8th, 9th and 10th positions of the … | |
Re: How about saving all the time tables as files, and putting them in a directory? All managed. | |
Re: Perhaps a better way to assign scores would take account of all the possible hands. For example, the fact of getting a pair is 100 points, and then add another value which is the sum of the two cards making the pair. In this way, a pair of threes would … | |
Re: Many hardware devices map real world characteristics (voltage, current, state of LED etc.) to fixed memory addresses. Accordingly, you have no option but to create a pointer that points to exactly that memory address. If you read in the manual that the value you are interested in will be put … | |
Re: You are using the variable [B]counter [/B]to store how many times the button has been pushed. You can display this value with the [B]printf [/B]command: [CODE]printf("%i ", counter);[/CODE] | |
Re: MFC is just a set of classes and various helper functions to make interacting with the Win API easier. What do you want to [I]do[/I] with the MFC classes that you're not doing already? | |
Re: In [B]void encyrpt (void)[/B] you define [B]g[/B] but don't use it. Might as well kill it. | |
Re: [url]http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html[/url] | |
Re: abort() causes a SIGABRT signal, which will then be caught by the appropriate signal handler (which by default usually causes the programme to terminate with an [I]unsuccessful termination[/I] code returned to the environment). exit() terminates the process a bit more carefully. Any functions you registered with the atexit() function get … | |
Re: Head over to Project Euler and start at the first exercise. | |
![]() | Re: Use function rand function. Find example on the google google. ![]() |
Re: You should learn to use a debugger; here's the output from gdb running your code. [QUOTE] Program received signal SIGSEGV, Segmentation fault. 0x004014aa in singlylinkedlist::add_after (this=0x22ff58, count=1, num=2) at 15.cpp:132 132 q=q->next;[/QUOTE] It seems that you are trying to dereference a null pointer (i.e. q->next). | |
Re: A vector is marvellous. It is for any object you care to define. [CODE]vector<int> someVector; // vector of ints vector<crazyStructure> someOtherVector; //vector of crazy structures[/CODE] Anything you like. Go nuts with it. :) | |
Re: [B]system("PAUSE");[/B] This instructs your programme to ask the shell it is running inside to execute the command [B]PAUSE[/B], just as if you had typed [B]PAUSE [/B]into a command line yourself. Your shell has no such command, and hence returns as error message. As I recall, this command commonly exists in … | |
Re: struct has default visibility of its members as public. class has default visibility of its members as private. That's the whole difference. For historical reasons, convention is to use structs for occasions when you are going to fill it only with plain old data, or POD - that is, no … | |
Re: Your divides function takes two int objects as parameters, and returns an int. Accordingly, you must call it like this: [CODE]returnedInt = divides (someInt, someOtherInt);[/CODE] where [B]returnedInt[/B], [B]someInt[/B] and [B]someOtherInt[/B] are all of type [B]int[/B]. | |
Re: You have not named the parameter being passed into the first function. | |
Re: How about having the user enter their whole name in one string, and then you take that string apart for the words in it. If there are two words, there is no middle name. | |
Re: con.getusers() returns a copy of the vector. You are then working on the copy of the vector; the vector inside con never gets changed. | |
Re: On line 47, you are using the value of 'd'. Tell me, what is the value of 'd' at line 47? Where did you initialise it with a value? | |
Re: For openGl, try this link: [url]http://lmgtfy.com/?q=opengl[/url] | |
Re: [CODE]if (product.sPromo="Yes")[/CODE] 'product' is the definition of a kind of structure; it is not an actual instance of that structure. You need to decide which object that you have created you want to test. I expect it's one of that array of product you created; the array named 'products'. | |
Re: As a general rule of thumb, if you're trying to read location 0x00000000, it means you're trying to dereference a null pointer, either directly or by trying to use a member function/variable of a null object. | |
Re: C++ has no inherent understanding of a mouse, a picture or a window. This is all heavily dependent on your chosen operating system and your chosen window manager. | |
Re: That typedef doesn't look right; you've not actually given the new typedef'd name for the struct. It probably churned up a warning. Also, it's unnecessary in C++. You can just define a structure and then use it like any other type, which seems to be exactly what you're doing. | |
Re: Hi Spoons. Still chasing pointers, I see. It's been months now, and you've not got anywhere. Maybe it's time to take a break and come back to it in a few months. | |
Re: An alternative method is to write a shell script that first runs your original programme, and then when that's finished runs the compiler on the created source code. I do that with a bash script as follows: [CODE]#!/bin/bash make intermediate ./intermediate make unitTester rm intermediate mkdir unitTesterDir mv unitTester unitTesterDir/unitTester … | |
Re: It's my time to waste as well, and I'm very familiar with Miss Licker from other sites. I'll have a go at this. Imagine you had a lot of objects. You decide that to make it easy to keep track of them, you will stick a label on each one. … | |
Re: I take it you're only using greyscale images (i.e. no colours)? The following shows how to access the RGB values of each pixel, which for a greyscale image will probably just be the same value, but it's worth checking how your image pixels are represented. [url]http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html#SECTION00053000000000000000[/url] | |
Re: It certainly is possible. This chap did it - [url]http://www.homebrewcpu.com/[/url] | |
Re: [B]delete[/B] is what you use to deallocate some memory you allocated using [B]new[/B]. I don't see any such allocation. | |
Re: MFC has been around for a long time, though. You can buy a genuine copy of Visual Studio from yesteryear on eBay (anything after VS6 will probably do) for a pittance and get started with that. I bought a copy of VS2003 for just this purpose a couple of years … | |
Re: As an aside, please do not put [CODE]using namespace std;[/CODE] at the top scope of a header file. You can get away with it when it's just play code for your own use and you know it's there, but if anyone else ever included a header file you wrote with … | |
Re: You're trying to use [B]cout[/B] and [B]cin[/B] without having included the right header, but apart from that, you just need to organise your code better so you can see which if and else statements match up with each other. [CODE]#include <fstream> #include <iomanip> #include <cmath> #include <iostream> using namespace std; … | |
Re: No no, he said [QUOTE]I wana to make keygen that [B]not[/B] randomly codes[/QUOTE] Here's one that's suitably not random :) [CODE]#include <string> std::string generateKey (std::string username, std::string password) { return (username + password); }[/CODE] | |
Re: [CODE]wordone[5][/CODE] does not exist. The final element in your char array is wordone[3]. If you want to be able to fit four letter and a terminating zero in your char array, you must make it at least 5 elements long, like this: [CODE]char wordone[5];[/CODE] and then you can put a … | |
Re: Unresolved external generally means that your code is fine, but you're trying to link to already compiled libraries that can't be found. Looks like you have an executable, so I'm guessing you're using dynamic linking and the failure is at runtime. What happens if you switch to static linking? There's … | |
Re: Please don't use "this" as an example to mean "anything at all". "this" is a C++ keyword with a specific meaning. [CODE]Employee e1 = new Employee(); // will not work[/CODE] new returns a pointer. You cannot assign a pointer to a non-pointer variable. You could do this: [CODE] Employee e1; … | |
Re: Lucky you. Some people do, and they need a way to know for sure that the stream and its output sequence are synchronised. | |
Re: I was asked to write a linked list in straight C, where each element contained an integer and a pointer to the next one. | |
Re: Here are two protoypes to get you started. bool gradeIsValid(char* grade); int gradeToGPA(char* grade); | |
Re: [CODE]int main() { return 0; }[/CODE] This compiles fine on my system; it must be your setup. Did you definitely make it clear that you wanted to create a console programme and not any kind of windowed programme? | |
Re: How about something like this? [url]http://www.cplusplus.com/reference/clibrary/cctype/isdigit/[/url] | |
Re: The nullptr idiom was suggested by Stroustrup and Sutter, two well known faces in C++, in this draft proposal: [url]http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf[/url] which you will see on this chart: [url]http://gcc.gnu.org/projects/cxx0x.html[/url] is available from gcc 4.6 The intention is for it to become a keyword in C++0x. As such, it's currently non-standard and, … | |
Re: It is possible to pass that value 'n' into the function. What is not possible in C++ at the current version is to create an array like that (i.e. an array whose size is not known at compile time) on the stack. You will have to allocate it dynamically using … |
The End.