1,288 Posted Topics

Member Avatar for Nandomo

If you run this under a debugger, it'll tell you which line of code is causing the crash.

Member Avatar for Nandomo
0
171
Member Avatar for spetro3387

Read this and do the one appropriate for Win or *nix, depending on what you're coding for. [url]http://doc.qt.nokia.com/latest/qcoreapplication.html#arguments[/url] The arguments are taken from the arguments you pass to the main function when you start the programme. What command line arguments are you passing in to main?

Member Avatar for spetro3387
0
160
Member Avatar for emreozpalamutcu

Well if you're not coding in C++, you've perhaps not picked the best forum on which to ask questions. :)

Member Avatar for jonsca
0
109
Member Avatar for Mayank23

Is he running the code from the command line by typing it in, or by double-clicking it in some kind of file browser?

Member Avatar for Nandomo
0
144
Member Avatar for CrazyPixel

Can we see the line that causes the errors, and a few lines either side of them?

Member Avatar for CrazyPixel
0
384
Member Avatar for alex55

monthSum and monthAverage have a length of some size 'month' They start at monthSum[0] and go all the way to monthSum[month-1]. If you write something to monthSum[month], you will be writing off the end of the array (which lives on the stack) and over something else that is on the …

Member Avatar for alex55
0
122
Member Avatar for dennis.d.elston

[CODE]void Car::get_gas()[/CODE] While I'm here, take a close look at how you are calculating the fuel_level.

Member Avatar for dennis.d.elston
0
1K
Member Avatar for anirudhruia

[CODE]contact[20][/CODE] is off the end of your array. The last element of your array is contact[19] [CODE]p=&cse2[10];[/CODE] is off the end of your array. The last element of cse2 is cse2[9] You need to read up on arrays and also the scanf function.

Member Avatar for Moschops
0
84
Member Avatar for jackmaverick1

That bit that says [QUOTE]previous definition of 'class player'[/QUOTE] will tell you where you already defined it. If you look at that, you'll be able to see where you defined it already. Sounds obvious, I know.

Member Avatar for Fbody
0
8K
Member Avatar for do vale
Member Avatar for Moschops
0
191
Member Avatar for iwannalearn

On the other hand, why not learn a language that lends itself to a different way of programming? I suspect that if you go straight into Java from C++, you'll learn the different syntax but ultimately it won't do much to make you a better problem-solver. If you were to …

Member Avatar for Moschops
0
147
Member Avatar for RolandTheNerd

Pick out your chosen build environment and make sure you get the tools you need. Do not, I repeat do not, install Dev-C++. I often recommend a simple text editor and manual command-line compilation tools (gcc springs to mind), but this is something of a niche opinion :)

Member Avatar for vinayakgarg
1
199
Member Avatar for johans22

If you want array to store pointers, you'll have to make it an array of pointers: array = new int* [s]; array will be pointer to an int pointer, like this: int** array; When you set the size in your code, if the size has already been set, you will …

Member Avatar for Fbody
0
150
Member Avatar for johans22
Member Avatar for daniel1977

Are you sure that every member function has a definition (not just a declaration)?

Member Avatar for daniel1977
0
163
Member Avatar for hanvyj

You are attempting to fiddle around with memory that does not belong to your programme. Make sure that all the memory from PixelBuffer to PixelBuffer+PixelBufferSize and ucBuffer to ucBuffer+PixelBufferSize belongs to you.

Member Avatar for hanvyj
0
5K
Member Avatar for angelshonu11
Member Avatar for Jonellys

Connect to ftp server: sftp [email][email protected][/email] Enter password, then use 'ls' to list directory contents, 'cd' to change directory, 'get filename' to download a file, 'put filename' to upload. Check your ftp programme's documentation to ensure you upload and download in binary format, rather than treating the data as text.

Member Avatar for Moschops
0
173
Member Avatar for pucivogel

I haven't read your example code as I'm in a rush, but if you ever have a char array, and you want to carry out string operations on it, you can turn it into a string, carry out your operations, and then turn it back to a char array. [CODE]#include …

Member Avatar for Moschops
0
135
Member Avatar for SolidSora

This error would imply that your compiler cannot locate the file known as countertype.h Is the compiler looking in the right place for it, and have you definitely called it countertype.h ? As an aside, I note that your second file there, which I imagine to be countertype.h, contains a …

Member Avatar for JasonHippy
0
223
Member Avatar for Duki

Or you can explicitly make pointers and pass those by value. [CODE] char* a; char* b; int* c; method(a, b, c);[/CODE]

Member Avatar for Duki
0
216
Member Avatar for Annettest

Firstly, be aware that the appropriate time to use exceptions is a matter of opinion, and if you ask five people, you'll get back more than five different opinions :) All the following, thus, is my opinion. To my mind, the clue is in the name; exceptions are for exceptional …

Member Avatar for Moschops
0
174
Member Avatar for rohan1020

It depends on the sensor you are using. Some microphones measure pressure, some measure rate of change of pressure, some measure others things.

Member Avatar for Moschops
0
110
Member Avatar for Nandomo

I'm something of a fan of the easyBMP library. Here's some incomplete pseudo-code that should demonstrate the ease of fiddling with bmp images using it. [CODE] #include "EasyBMP.h BMP theBMPImage; theBMPImage.ReadFromFile("somefile.bmp"); width = theBMPImage.TellWidth(); height = theBMPImage.TellHeight(); // Over all pixels, using height and width in a loop.. // Readpixel …

Member Avatar for Moschops
0
129
Member Avatar for trebor-pl

Linking errors means that the code you've written makes sense, but when the linker goes looking for some functions you have promised to provide (usually in a header file), it can't find them in a compiled form. These functions look like the default constructors for CPerson, CCustomer, CStaff and CGame.

Member Avatar for trebor-pl
0
338
Member Avatar for SolidSora

On lines 10 and 11, you create two variables; an int and a char. You then, on line 32, concatenate them with a std::string. This is where the problem is. If you made those two variables std::string as well, you'd get the seat output on line 33. Alternatively, leave them …

Member Avatar for SolidSora
0
174
Member Avatar for TailsTheFox

If you include windows.h, you can use the MessageBox [url]http://msdn.microsoft.com/en-us/library/ms645505(v=vs.85).aspx[/url]

Member Avatar for TailsTheFox
0
4K
Member Avatar for artur7

For those of you who like newlines in your code, I present the following: [CODE] class X { int data_; void f() { //shall I cache var data_? by doing int cached = data_ //and instead of this: if (data_ >= 0 && data_ < 1000 || data_ < 0 …

Member Avatar for mrnutty
0
98
Member Avatar for gerard4143

As Fbody made clear, that object will only die when you hit it with delete, and the reference IS the object - not a copy of it, not a pointer to it. If you replace myfunc with the following, you'll see that the object dies as soon as it goes …

Member Avatar for gerard4143
0
2K
Member Avatar for jusami

A "class" is a kind of C++ object that you can define and then create. If you need to include one, I suggest you read up on what classes are, and then write one. [url]http://www.cplusplus.com/doc/tutorial/classes/[/url]

Member Avatar for thelamb
0
108
Member Avatar for SolidSora

What's the actual error message(s) from the compiler? I note that you're using new and feeding it Seat("A1", true), which seems a bit wrong as new has no such prototype; [url]http://www.cplusplus.com/reference/std/new/operator%20new/[/url] What happens if you abandon using new and just try this, within your actual main function? [CODE] Seat A1 …

Member Avatar for Fbody
0
144
Member Avatar for SacredFootball

Since you're just looking for a tip to get you started, here's a clue to look up: "pointer arithmetic".

Member Avatar for Moschops
0
195
Member Avatar for simply_viks
Member Avatar for hvalola
0
88
Member Avatar for Kimmi

C++ knows nothing of colours. C++ knows nothing of your screen. To alter colours on the screen, you will have to go looking for information on the C++ libraries provided with your operating system, which are available to you through the API.

Member Avatar for Moschops
0
204
Member Avatar for Violet_82

I note you have put [code]using namespace std;[/code] at the top of your header file. This is considered bad form; anyone who ever includes a header file with this at the top of it will have their namespace polluted with no warning whatsoever. As an aside, it looks like you …

Member Avatar for Violet_82
0
173
Member Avatar for MasterGberry

C++ 98 does not accept variable sized arrays. You must define the size of an array at compile time. If you cannot know the size at compile time, you will have to allocate memory yourself, or alternatively use one of the C++ STL container classes.

Member Avatar for MasterGberry
0
127
Member Avatar for Koldsoul

Bumping a year old addendum to a four year old thread? If you have a question, start a new thread :)

Member Avatar for NathanOliver
0
4K
Member Avatar for Moschops

With much pleasure I've started using a TR1 imlpementation. I'm a bit wobbly with it, but I'd dearly like to replace some code involving old-school pointers with some shared_ptr The original code is as follows below. It creates an array int* of size rows, each of which points to an …

Member Avatar for Moschops
0
166

The End.