1,288 Posted Topics

Member Avatar for shylesh_kerala

[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.

Member Avatar for Moschops
0
171
Member Avatar for Marcial

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 …

Member Avatar for Marcial
0
205
Member Avatar for dahaker

[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 …

Member Avatar for dahaker
0
3K
Member Avatar for andimiami

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 …

Member Avatar for andimiami
0
220
Member Avatar for KeerthigaN

How about saving all the time tables as files, and putting them in a directory? All managed.

Member Avatar for Moschops
-2
38
Member Avatar for ywong89

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 …

Member Avatar for ywong89
0
5K
Member Avatar for WildBamaBoy

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 …

Member Avatar for WildBamaBoy
0
172
Member Avatar for cheers07

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]

Member Avatar for Moschops
0
117
Member Avatar for dyingatmidnight

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?

Member Avatar for Moschops
0
200
Member Avatar for margeaux54
Member Avatar for margeaux54
0
189
Member Avatar for txwooley
Member Avatar for txwooley
0
120
Member Avatar for muze
Member Avatar for dspjm

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 …

Member Avatar for dspjm
0
1K
Member Avatar for shekhartanwar
Member Avatar for Moschops
0
37
Member Avatar for HASHMI007
Member Avatar for HASHMI007
-8
154
Member Avatar for viki_chennai

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).

Member Avatar for Moschops
-1
132
Member Avatar for fpsasm

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. :)

Member Avatar for fpsasm
0
340
Member Avatar for determine

[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 …

Member Avatar for determine
0
4K
Member Avatar for iamcreasy

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 …

Member Avatar for Narue
0
137
Member Avatar for caltech

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].

Member Avatar for caltech
0
126
Member Avatar for cppgangster

You have not named the parameter being passed into the first function.

Member Avatar for cppgangster
0
112
Member Avatar for SolidSora

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.

Member Avatar for atticusr5
0
108
Member Avatar for Vanquish39

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.

Member Avatar for Fbody
0
151
Member Avatar for rbduck09

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?

Member Avatar for rbduck09
0
224
Member Avatar for Muhammad Sumair
Member Avatar for Muhammad Sumair
0
183
Member Avatar for yeahyeah85

[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'.

Member Avatar for yeahyeah85
0
96
Member Avatar for cppgangster

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.

Member Avatar for cppgangster
0
554
Member Avatar for emreozpalamutcu

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.

Member Avatar for emreozpalamutcu
0
633
Member Avatar for Dexxta27

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.

Member Avatar for Dexxta27
0
154
Member Avatar for spoonlicker

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.

Member Avatar for katokato
-1
695
Member Avatar for KazenoZ

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 …

Member Avatar for KazenoZ
0
147
Member Avatar for spoonlicker

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. …

Member Avatar for Nick Evan
-1
228
Member Avatar for dolly_olaide

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]

Member Avatar for dolly_olaide
0
5K
Member Avatar for spoonlicker
Member Avatar for caut_baia

[B]delete[/B] is what you use to deallocate some memory you allocated using [B]new[/B]. I don't see any such allocation.

Member Avatar for caut_baia
0
561
Member Avatar for cppgangster

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 …

Member Avatar for Moschops
0
136
Member Avatar for zhinokin

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 …

Member Avatar for zhinokin
0
604
Member Avatar for plang007

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; …

Member Avatar for Software guy
0
192
Member Avatar for xxxferraxxx

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]

Member Avatar for Moschops
0
110
Member Avatar for beejay321

[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 …

Member Avatar for Moschops
0
228
Member Avatar for MykMallett

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 …

Member Avatar for Moschops
0
248
Member Avatar for amitapm

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; …

Member Avatar for amitapm
0
139
Member Avatar for lochnessmonster

Lucky you. Some people do, and they need a way to know for sure that the stream and its output sequence are synchronised.

Member Avatar for lochnessmonster
0
147
Member Avatar for ajst

I was asked to write a linked list in straight C, where each element contained an integer and a pointer to the next one.

Member Avatar for Moschops
0
92
Member Avatar for Shadbanks001

Here are two protoypes to get you started. bool gradeIsValid(char* grade); int gradeToGPA(char* grade);

Member Avatar for sfuo
-2
396
Member Avatar for RodEsp
Member Avatar for mohamed_nasr

[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?

Member Avatar for mohamed_nasr
0
594
Member Avatar for MultipleMoney

How about something like this? [url]http://www.cplusplus.com/reference/clibrary/cctype/isdigit/[/url]

Member Avatar for MultipleMoney
0
1K
Member Avatar for L3gacy

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, …

Member Avatar for mike_2000_17
0
401
Member Avatar for JordanHam

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 …

Member Avatar for Nandomo
0
177

The End.