Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

How you write it is a little unconventional, but should still compile ok. You just have unnecessary parentheses.

for(std::vector<string>:: iterator s = str1.vec.begin(); s != str1.vec.end(); ++s)

I can't really say what the problem is without seeing the whole program.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 7 is incorrect -- instead of ++i it should probably be ++s.

does line 14 show that *s and *s2 are the same strings?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Click Here

When you hit cancel should the editor put that text into the post?? If yes, then what's the purpose of the Cancel button?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

How did the link get into this post? The op said he/she didn't put it there.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

lines 12 and 15 are wrong. According to line 27 the parameter to multiply() is not a callback function, but just a simple integer.

int multiply(int a, int x)
{
    int r = x; 
    int e = a * r;
    return e;
}

If you really intend to pass the add() function as a parameter, then do something like this. Note that since add() takes two parameters, main() must supply those values on line 27, OR multiply() must supply them itself.

int multiply(int a, int(*x)(int, int),int b, int c )
{
    return a * x(b,c);

}   

If you want main() to supply the two parameters to main(), line 27 would look like this:

cout << multiply(10,add,2,5) << endl;

Otherwise if multiply() is to supply the two parameters

int multiply(int a, int(*x)(int, int) )
{
    return a * x(2,5);

}   

cout << multiply(10,add) << endl;
furalise commented: Well constructed answer. +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

LOL -- a beginner's mistake (embarrassed)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I have gcc version 4.8.1, (c) 2013 and may be outdated. It was installed with Code::Blocks version 13.12 just the other day. Here are the errors.

mingw32-g++.exe -Wall -fexceptions -g -std=c++11 -Wall  -c C:\dvlp\Test\main.cpp -o obj\Debug\main.o
C:\dvlp\Test\main.cpp: In function 'void show(void*, int, int)':
C:\dvlp\Test\main.cpp:3:21: error: invalid conversion from 'void*' to 'int (*)[(((sizetype)(((ssizetype)w) + -1)) + 1)]' [-fpermissive]
     int(*univ)[w] = u;
                     ^
C:\dvlp\Test\main.cpp:3:10: warning: unused variable 'univ' [-Wunused-variable]
     int(*univ)[w] = u;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

display star of entered date of birt

What does that mean?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Sorry, we don't do you homework for you. Post your attempt to solve the problem then ask specific question(s) about what you don't understand.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

LINE 3 is not a valid C statement -- it won't compile with either VS2013 or MinGW (Code::Blocks)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

My guess is that he found some code written for *nix and is trying to compile it with an MS-Windows compiler -- MinGW compiler is pobably the only MS-Windows compiler that uses it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Lines 1, 5, and 6 are not valid C statements. Possibly some other language.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You are missing some brackets. statements that are two or more lines require brackets, like this:

if (Exempt == 'Y' )
{
    cout << "Gross wages = " << (hoursWorked*hourlyRate) << endl;
    cout << "NO TAXES DEDUCTED";
{   
else if (Exempt == 'N')
{
    cout << "Gross wages = " << (hoursWorked*hourlyRate) << endl;
    cout << "Wages after taxes = " << (hoursWorked*hourlyRate)-((hoursWorked*hourlyRate))*0.18 << endl;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Your link doesn't work.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The problem most likely is that after you enter the Choice you then press the Enter key. After line 25 the Enter key '\n' is still in the keyboard buffer because scanf() didn't remove it so the next time scanf() is called it appears to do nothing because it sees the '\n' enter key. To fix that problem you need to remove the '\n' from the keyboard buffer. There are several ways to do it but the easiest is probably

char ch[2];
scanf("%1s",ch);
switch(toupper(ch[0])
{


}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 64: you can not compare two character arrays using the == operator, you have to call strcmp()

if ( strcmp(custDB[i].state,stateCode) == 0)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You need to create threads in order to do parallel program. How to do that depends on the operating system you are using, or threading extensions of c++11 standards. A third option is to use boost threading library. If you are using a pretty new compiler, such as most recent version of g++ it will support c++11 threading.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 40: you forgot the class name before function name. float Student::setEnglish(

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Then you might want to start by learning a game driver such as OpenGL (there are others)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You start by learning the fundamental math of circles (click here).

Then you read your textbook or online tutorial about how to create a simple java program.

No one here will do your homework for you, so you might as well start studying.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

For version, see here

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There's no ambiguity -- she refers to Stephanie. I don't recall the exact rule, but she always refers to the closest object, in this case Stephanie.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

but it's just a warning so I'm ignoring it.

You should never ignore warnings (except maybe in compiler-supplied header files) because 90% of the time they are really errors.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Your computer is probably missing the readline folder and associated header files and library files.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The problem is that Win8 for the most part ignores those ports.

My PC is running Windows 8.1 and it has lots of USB ports with no problems. Maybe it's just a laptop thing.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

When I get it to a point where I want to do a checkpoint I type "archive projfolder" and it creates a zip file

Does VS do that for you or are you using something like WinZip? I looked all over VS C++ project and couldn't find such a menu item.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 50 should probably be the same as line 38.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If you want all the characters on the same line then remove the newline character '\n' from the cout statement(s).

The second comparism doesn't seem to come out well too

Line number please???

I was told its completely C++

You mean NetBeans? It's an IDE that's used for several different languages.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You might want to use sizeof there instead of hardcoding a number. That way when you change the size of the fields in the structure you won't have to bother making similar changes throughout the rest of the program. Hardcoding numbers like you did leads to lots of bugs that are often difficult to find.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 26 has two problems:

position should not be decremented on line 26, decrement it after line 29.

the loop should continue while position > 0 instead of > 1.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The problem is that there is no memory allocated to the members of that structure -- they are just pointers whose address is unknown. cin does not allocate memory -- that is your responsibility. Try this structure

struct Student {
    char firstName[100];
    char lastName[100];
    char telephone[20];
};

line 22: why do you want a 100-digit telephone number?? I don't think there are any phone numbers in the whole world that has that many digits. Reduce that to something more reasonable, such as 10 or 15. Even that is probably more than enough.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

SetParents() does not need a reference to a pointer -- just the pointer

_clients->at(FreeIdx).GetPlayer()->SetParents(this, __clients->at(FreeIdx));

When passing a poitner by reference the & operator is not used in the actional function call, only in the function prototype and function header. The & in the actual function call makes it a pointer to a pointer, not a reference to a pointer.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I'm running the same version number of Chrome you are.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Are you running Chrome under Windows or *nix? In Windows 8.1 I used Task Manager to view the process memory and didn't notice that much memory being taken up by Chrome -- with only one tab for DaniWeb there were 3 processes, the largest consumed about 70Mg. After about 10 minutes the memory had increased by only about 1/2 meg.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I notice you have use parentheses in places where they aren't needed, for example line 159 the ( is in the wrong place. itemNuimbers has to be dereferenced before the value of mid can be added to it's value. Otherwise the way you have it coded the valie of mid will be added to the address of itemNumbers which is wrong, not to the value that itemNumbers points to.

if (searchValue == (*itemNumbers+mid)) {

Since you are required to convert from array notation to pointers, you might need to modify the sortData() function. For example
itemNumbers[count] = itemNumbers[count + 1];

would become

*(itemNumbers+count) = *(itemNumbers+count + 1);

In the above, the parentheses suround itemNumbers+count because the value of count is added to the address stored in itemNumbers in order to achieve the same as itemNumbers[count]

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

it crashes because the second parameter to itoa() must be a characte array, not just a pointer. See the example here.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

there are now cloud based version control systems, never used it and probably wouldn't use it for sensitive programs such as government classified programs. But for non-sensitive stuff I would be pretty handy because you wouldn't be restricted to accessing the data from just a single computer or usb file. So if you had a team of programmers who were scattered all over the world a cloud based version control system would be ideal, at IMO.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

readfile() expect the first parameter to be a pointer to a pointer -- you only provided the pointer on line 29. Here is how the first parameter should look like. All the other parameters have the same problem.

readFile(&itemNumbers, itemPrices, itemQuantities, arraySize);

Since itemNumbers has two stars in order to allocate memory to it you need to dereference the variable, for example line 71

*itemNumbers = new int[itemCount];

This allocates memory to the variable that's declared in main().

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I've sometimes said that too -- it's a toung-in-cheek way of saying we aren't going to write the program. But ... if someone really puts a million dollars usd in my paypal I'll gladly see to it that he/she gets the program.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

mahroza: how will including stdio.h resolve the problem???

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I think Microsoft removed that in later versions of the compiler because I can't find isctype.h in either 2012 or 2013. Here is anoter thread on the same topic.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You write the code, we only answer questions.

rubberman commented: Subtle as always AD. :-) +12
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Which line contains the error? What compiler are you using? I compiled with Visual Studio 2013 and did not get any errors.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

because it, along with conio.h, isn't a standard c function. Not very many compilers support it. That's the unfortunate consequences of learning to program on ancient 30-year-old compilers such as Turbo C and Turbo C++. They were good IDEs in their days but have long been obsolete.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

have you tried google?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I cannot get things to work on my Windows 7 PC.

What kinds of problems are you having? As I recll from 25 years ago dBase ran under MS-DOS version 6.X and earlier. Under Windows 7 you may have to install DOSBox and run it in that environment.Click Here

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If all you want to display is the files in the folder then call Directory.GetFiles() method. You don't need a tree to do that, unless what you really want is a list of folders that you can select then display the files within the selected folder, like FileExplorer does.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Sorry about the lengthy delay in answering your question -- if you haven't already done it all you have to do is create a new console project and add the files you have already written to it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Fast and Furious 6 -- good movie with lots of car races and other action.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Pirate Grammer

2b7ae93554145df953308912de591394

Reverend Jim commented: I love it. +0