1,288 Posted Topics

Member Avatar for LucyLogic

As Schol says, help us to help you. What does your program do that you don't want it to; what does it not do that you think it should; what input do you type into the keyboard to demonstrate the bad behaviour; what output do you get on screen.

Member Avatar for David W
0
3K
Member Avatar for uonsin

Error codes are not universal. Those are error codes your compiler happens to use. Other compilers do things differently, so don't quote error codes; tell us what the actual error is. What are the errors, and on what lines are they?

Member Avatar for uonsin
0
346
Member Avatar for ashley.vanhoesen.7

Could you change your while condition so that you don't stop when the queue is empty, but instead stop when `queue.size()` is one?

Member Avatar for NathanOliver
0
287
Member Avatar for Rallici

ld is the programme that links your object files together. It's either been deleted, or you're looking in the wrong place for it.

Member Avatar for learner_new
0
2K
Member Avatar for chipo

char year= "YYYY"; You're trying to create a char object here.A char object can hold ONE char. One. You're trying to somehow store "YYYY" in an object that can hold ONE char only. `year[] = "YYYY";` would do what you want. Likewise with month and day.

Member Avatar for David W
0
160
Member Avatar for OpenTheTrollGate

Iterators aren't the same thing as pointers. Testing an iterator against NULL makes no sense. Typically, an iterator is tested for being beyond the range of the container by comparing it to the iterator returned with `end`, e.g. `if(s2 == str2->vec.end())`

Member Avatar for OpenTheTrollGate
0
90
Member Avatar for learner_new

You don't need to initialise the variable `len1`. You set a value before you use it, so that's fine. I see that your main function returns on line 19, so line 20 and line 21 will never be executed. This seems silly. Your code compiles and runs fine. The only …

Member Avatar for shaykhhamza
0
301
Member Avatar for mixelplik

Your function dateparse creates a char array named `year`, and then you set that to a string, somehow, and then you call c_str on it, even though it began life as a char array. Does this code even compile?

Member Avatar for David W
0
212
Member Avatar for boris90

Show us the code (and yes, fix the warnings - the ones about not every control path returning a value are actually pretty serious and even if it did build, it was broken, and you'd generated some kind of mutant frankencode). It is quite possible to write code that a …

Member Avatar for dreslough
0
2K
Member Avatar for blazemadej

Let's start with the function getGrades. > -GetGrades function should get number of grades, read the grades entered, find the sum of those grades and pass the sum and number to FindAverage. The code you have for that function does this: Gets the number of grades. Uses the right shift …

Member Avatar for blazemadej
0
14K
Member Avatar for jr.sayre3

Do you know how to do this on paper? Do you understand what is meant by a number being in a base other than base 10?

Member Avatar for Lucaci Andrew
0
125
Member Avatar for ramrokers

Turbo C++ was written for DOS, back in the early nineties. Are you running a PC from twenty years ago? If not, I suggest you instead use a modern compiler. This will have the advantage that you can use actual C++ instead of C++ from twenty years ago which a …

Member Avatar for Schol-R-LEA
0
172
Member Avatar for Emma_3

I don't see you storing the grade in a char array. if ( score >= 92.0 ) { grade[i] = 'A'; } and so on.

Member Avatar for Moschops
0
295
Member Avatar for blazemadej

Line 17 AND line 19 are reading from file. Change line 17 to this: `while (inputFile >> hours && inputFile >> pay)` Remove line 19.

Member Avatar for blazemadej
0
178
Member Avatar for Isabella Angeliese

If I had to guess, one of your character tests or manipulators (isupper, toupper, islower, etc) is failing an assertion because you're giving it bad input.

Member Avatar for Ancient Dragon
0
814
Member Avatar for Mazi007

How would you do it on paper? Serious question. Programming begins with thinking. Here is some code: int main() { std::cout << "Hello world"; } How do you know how to indent that?

Member Avatar for Moschops
0
81
Member Avatar for Dang_1

Looking at this code, it seems that `_ps` is a pointer to a string object. So this: `_ps->copy` is an attempt to use the string class function named `copy`. Here is the prototype of that function. `size_t copy (char* s, size_t len, size_t pos = 0) const;` So the first …

Member Avatar for Dang_1
0
110
Member Avatar for alaa ashraf
Member Avatar for codeMonkey94
0
106
Member Avatar for mirchi mirchi

How about a program containing a function that creates an array of structures and loops over it?

Member Avatar for mirchi mirchi
0
115
Member Avatar for andreas.petrou.967

Your first `for` loop is calculating lots of results, and throwing them away. You should calculate a results, and then output it, and then move on to the next result.

Member Avatar for andreas.petrou.967
0
2K
Member Avatar for Learner010

On class functions, it is a promise that this function will not change any member variables of the object. There is an exception, and here is the next keyword for you; `mutable`. When a class member is declared mutable, it *can* be changed by a function with const on. The …

Member Avatar for Learner010
0
186
Member Avatar for bogoreh

The same way you make an array of anything. char nameOfStruct[20]; // This makes an array of 20 char objects struct exampleObject nameOfStruct[40]; // This makes an array of 40 exampleObjects

Member Avatar for bogoreh
0
282
Member Avatar for larry burns

How often does the industry sector in your part of the world ask people about their public code repositories? The last time I was looking for work (about seven monthes ago), only one of my six leads asked about it and when I told them I didn't have one, they …

Member Avatar for Moschops
0
150
Member Avatar for narvey ann

#include <iostream> int main() { std::cout << "2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97" << std::endl; }

Member Avatar for rubberman
-1
238
Member Avatar for boomboombugsh

[CODE]#include "stdio.h" int main() { int i; for (i=0; i<4; i++) { switch(i){ case 0: printf("1\n"); break; case 1: printf("23\n"); break; case 2: printf("345\n"); break; case 3: printf("4567\n"); break; default: break;} } return 0; }[/CODE]

Member Avatar for iqra liaquat
0
225
Member Avatar for Rahul47

As a general rule, processors access memory in chunks of a particular size (a "word"). A structure will be "padded" with unused memory so that the variables are aligned with these "words", making reading faster and simpler. If I had to guess, your structure actually looks like this in memory: …

Member Avatar for ddanbe
0
214
Member Avatar for Rahul47

Your `for` loop is always testing the same character; the first one. You are never changing the pointer, so `ptr` is always the pointing at the same place, so `*ptr` never changes.

Member Avatar for Rahul47
0
190
Member Avatar for skylinedrifter

> for some reason visual basic is not compiling it Visual Basic won't compile C++ code. Visual Basic is for working with Visual Basic code. To compile C++ code, you need a C++ compiler.

Member Avatar for Slavi
0
196
Member Avatar for siskaj

`#include “allegro.h”` is not the same as `#include "allegro.h"` Did you copy and paste that code from somewhere? Somewhere where the `"` symbol is replaced with `”`?

Member Avatar for siskaj
0
354
Member Avatar for dendenny01

On line five you create an int named `n`, which could have any value. Any value at all. Could be anything. On line six, you try to use an object named `a`, which you have not yet created. Are you trying to create an array there? Here is hpow to …

Member Avatar for dendenny01
0
347
Member Avatar for overwraith

I think you're asking what happens in this case: someObject* giveMeAnObject() { someObject anInstance; return &anInstance; } So you get back a pointer to an object made inside the function, on the stack. What happens is the memory is now available for other use and you're left with a pointer …

Member Avatar for overwraith
0
304
Member Avatar for furalise

In your example, Cstring is a pointer to a char, and you need to work on what it's pointing at; not on the pointer. The operator += applied to a pointer carries out pointer arithmetic; the operator += applied to a C++ string carries out whatever functionality the C++ string …

Member Avatar for furalise
0
295
Member Avatar for bEedzay

You've very nearly written all the code you need to answer those questions. #include <iostream> int main() { int number1 = 0; int number2 = 0; while(number1 < 5) { number1 ++; number2 += number1; } std::cout << "number1 = " << number1 << std::endl; std::cout << "number2 = " …

Member Avatar for AndrisP
0
210
Member Avatar for Adeel Rahat

No such compiler exists. All modern compilers use actual C++. The syntax isn't "changed"; it's "correct". If you want to write programs for MS-DOS in the year 1990, use Turbo C++ 3.0 If you want to write programs for a modern operating system, use a modern compiler (and use actual, …

Member Avatar for ddanbe
0
328
Member Avatar for Saba _1

`include<conio.h>` Non-standard, very old, not supported by modern compilers. `void main(void)` Just plain wrong. C++ recognises `int main()` `clrscr();` Non-standard, see conio.h `scanf("%d",item);` You should be passing a POINTER to item Your `if` and `else` branches are incorrect, missing brackets and that sort of thing. `getche();` Non-standard, see conio.h

Member Avatar for Moschops
0
143
Member Avatar for schugantor

Here is the method. 1) Write the program in a plain text file. People commonly name this something.cpp 2) Feed the plain text file to a compiler and then a linker. These give you an exectuable file. 3) Run that executable file. So you need to get a compiler, and …

Member Avatar for mike_2000_17
0
165
Member Avatar for anthony_5

Off the top of my head, you need to set the port number in the SMTPClientSession constructor call, and I wonder if gmail requires any kind of login more sophisticated than the default unauthenticated login attempt you get with `smtp.login(); ` Here's some example code: http://axistasoft.com/blog/poco/item/sending-e-mail-messages-using-poco-smtpclientsession-class

Member Avatar for Moschops
0
2K
Member Avatar for Roily Lucky

Without a lot, lot more information, no. What operating system? How are you creating the imagebox? How are you reading the video?

Member Avatar for Moschops
0
63
Member Avatar for Aleks134

You're set yourself a really good programing task here; it's simple to get something working, but there are many improvements and advances to be made from there. You need to think about how you would solve this on paper to start with. You've got a file, containing letters; you can …

Member Avatar for Moschops
0
155
Member Avatar for sumdumhoe

`stdprn` was a non-standard identifier provided by some very old DOS compilers. If you're not using a very old DOS system with something like Borland C from 1985, it won't work.

Member Avatar for Ancient Dragon
0
199
Member Avatar for nitish.mohiputlall

Your class is named `salaried` in the header, but `Salaried` elsewhere. See the difference?

Member Avatar for Moschops
0
2K
Member Avatar for tessa.burkhalterblackmon

The linker cannot find the function `TicketFineCalculator::TicketFineCalculator(int)` Something in your code is trying to call that function, and either it doesn't exist, or you haven't compiled the code containing it, or you have compiled it but the linker isn't being told about the compiled file. Start with the easiest possibilites; …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for yoyo.albeatiy

This thread discusses it at length: http://www.cplusplus.com/forum/beginner/1988/ The first suggestion, to have std::cout << "Press ENTER to continue..."; std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' ); right before your ` return 0;` should be fine. This solution requires you to` #include <limits>` and `#include <iostream>`. There are many, many more solutions.

Member Avatar for saharsweeto
0
175
Member Avatar for asmaa_4
Re: c++

`long int` is guaranteed not to be smaller than `int`; that's it. `long int` might be the same size as `int`, it might be bigger than `int`, it will not be smaller. In your system, it's the same size. On some systems, it might be bigger, so it could hold …

Member Avatar for yasir prince
0
113
Member Avatar for matt55284

http://www.cplusplus.com/doc/tutorial/basic_io/ I also suggest you help yourself out now and switch to using `string`s rather than naked char arrays.

Member Avatar for rubberman
0
354
Member Avatar for babyluxe03

`while(o!=9);` Did you meant ot have that semi-colon? This code is the same as this: while(o!=9) { }; Your code will loop forever, doing nothing. Anyway, here is how to ask a question that will get an answer: Present the code. Tell us what you did (e.g. what you typed …

Member Avatar for Moschops
0
315
Member Avatar for haider885

None of those look like errors: `Cannot find or open the PDB file.` No debugging file for this. Normal. `Application "\??\C:\Windows\system32\cmd.exe" found in cache` You're trying to run cmd.exe through system, so that doesn't seem too surprising. `The program '[7592] Shutdown.exe' has exited with code 0 (0x0).` Code 0 usually …

Member Avatar for Ancient Dragon
0
325
Member Avatar for pravej

Typically, I use the following on the command line to get the name of the last modified file. `ls -ltr | grep ^- | tail -1 | awk '{ print $(NF) }'` To include files beginning with `.`, I use `ls -latr | grep ^- | tail -1 | awk …

Member Avatar for iamthwee
0
7K
Member Avatar for gil.nickson

Where in your code is the cost of something added to the total? Also, it is a very bad idea to control program flow using `goto`. We have functions and control statements for that.

Member Avatar for noah_2
0
285
Member Avatar for COKEDUDE

You will be reading some numbers as strings, some strings as numbers, and you have no way of telling if you're meant to be reading a string or a number. You need to read every word as a string, examine it, and do whatever is appropriate if it's actually a …

Member Avatar for deceptikon
0
160

The End.