1,288 Posted Topics

Member Avatar for fyra

Do you mean it won't compile, or it won't link, or the IDE doesn't give you a nice tooltip?

Member Avatar for Moschops
0
255
Member Avatar for zpxix

You will get a much better response if you improve your questions. Here is how you can improve your questions: 1) Show us the code. You already do this. Good. 2) Tell us exactly what input you type in. 3) Tell us what you saw happen, and what you think …

Member Avatar for Banfa
0
214
Member Avatar for on93

`j = min(A,i);` At this point, the compiler is not aware of any function named min that takes an int-pointer and an int. cout <<"A.) Insert NEW Student Record."<<endl <<"B.) print all Student Record."<<endl; <<"C.) Sorting."<<endl; Take a good look at the end of that second line.

Member Avatar for Banfa
-1
570
Member Avatar for samii1017

You are using the same function, loadDog, to put data into all the four dog objects, so you are loading the Smokey data into all four. Perahps you meant to use each loading function once (loadDog, loadDog2, loadDog3, loadDog4).

Member Avatar for Moschops
0
137
Member Avatar for MRehanQadri

`head` is a pointer to a pointer to a store. So `*head` is a pointer to a store. So `*(*head)` is a store. So `(*(*head)).next` is the member variable next of the `store`.

Member Avatar for MRehanQadri
0
168
Member Avatar for nitin1

> but qstn is that why string is rejecting NULL at the end ? What does that mean? What do you think the string object g should contain after this: `g=s;`? What do you mean by saying it is rejecting NULL? I will explain what happens, and you can tell …

Member Avatar for Moschops
0
162
Member Avatar for kshahnazari

Do NOT #include a cpp file. Do NOT. The problem here is that you don't understand what the compiler does, what the linker does, and how they work together. Every cpp file should get compiled, and then all of them get linked together. If you're using some kind of IDE, …

Member Avatar for Moschops
0
283
Member Avatar for Engineer001

Is there supposed to be something between that `-1` and `(exp(double (n)))`? While I'm here, why is it `(double(n))` and not just `n`? Given that `n` is already a double. Likewise line 11.

Member Avatar for Moschops
0
2K
Member Avatar for LevyDee

If your code relies on the size of pointers, you're almost certainly doing it wrong. The whole purpose of pointer arithmetic is that it removes from you the need to know how big an object is, and to let the compiler handle it. Additionally, if you're using a void pointer, …

Member Avatar for LevyDee
0
179
Member Avatar for ThatJamaican

This `c:\users\pauline medwinter\documents\visual studio 2012\projects\testerproj\testerproj\blank.c(33):` tells you that the problem is on line 33 of the file named blank.c (or just before it). We are not psychic. If you show us the code, we can tell you what's wrong with it. I'd *guess* you've got a semi-colon where you shouldn't …

Member Avatar for Moschops
0
353
Member Avatar for Sci3nc3F1cti0n

Open the file in the mode that appends new data on the end instead of overwriting the existing data. `outfile.open("database.txt", ios::app);`

Member Avatar for Sci3nc3F1cti0n
0
226
Member Avatar for meetjatin88

In the function `combination` buffer is of size zero. It is a string object that contains no characters. You then try to change the first character like this: `buffer.at(i)=input.at(i);` The first character does not exist so an exception is thrown. Does VS2010 let you get away with compiling this code? …

Member Avatar for meetjatin88
0
244
Member Avatar for dhayalanbalakrishnan
Re: help

Your errors are not due to problems with headers being recognised. If the header file was not recognised the error would be something like "cannot find header file". These errors are linker errors. That means your code compiled fine, which means the header files were found without any problem. What …

Member Avatar for Moschops
0
337
Member Avatar for 9tontruck

> Should I manually release them as well? You *can't* manually release those. If you didn't create it using new (or malloc), you can't release it using delete (or free).

Member Avatar for Ketsuekiame
1
215
Member Avatar for Hey90

`Shoe` is an array of 50 `shoe` objects. Is an array of 50 objects of type `shoe` the same thing as a single object of type shoe? No. Can you call a class function of the `shoe` class on an object that is not an object of type `shoe`? No.

Member Avatar for Hey90
0
627
Member Avatar for anumash

Are you sure you're fseeking to the right place to start reading the data? If you're missing the data at the start, perhaps you're going too far with the fseek.

Member Avatar for Moschops
0
138
Member Avatar for nah094020

while(stillguessing == true); There is nothing in that while loop, so it loops forever. I expect you meant while(stillguessing == true) without the semi-colon

Member Avatar for Ancient Dragon
0
157
Member Avatar for ConfusedLearner

The code will read in three numbers: `cin>>x>>y>>z;` If you type in four numbers, the code doesn't change. It works the same. If you want to be able to enter four numbers, change the code to accept four numbers.

Member Avatar for Ancient Dragon
0
133
Member Avatar for lewashby

Here's something I wrote a long time ago: http://www.daniweb.com/software-development/cpp/threads/396591/c-pointers#post1701304 What you want begins around the comment `// need bigger array` That said, our pony-loving chum Deceptikon is right; you should use a proper C++ container, and if you want a proper C++ class specially made for char, look no further …

Member Avatar for 9tontruck
0
155
Member Avatar for dmd12b
Member Avatar for silvercats

This is some hideous code. You need to put a lot more thought into things *before* you touch the keyboard. Anyway, looks like you calculate the total cost of the order using the array `int takenorder [8];` That looks like a global array. Global values are, as a general rule, …

Member Avatar for silvercats
0
172
Member Avatar for johnnydiamond08

`if (k == temp*)` This is testing that the object k, which is an int object, is the same as a temp-pointer. It makes no sense. Are you trying to test that the int k is the same value as what the pointer temp is pointing at? That would be …

Member Avatar for Moschops
0
327
Member Avatar for kenney.d.lewis

You're not changing D, E or F. They are zero when you create them, they are zero when you do this: `y = ((D * C) - (A * F))/((A * E) - (D * B));` so you ARE dividing by zero. You need to learn about "pass by value", …

Member Avatar for Moschops
0
259
Member Avatar for VernonDozier

> If c = a * b, first test for a or b equalling 0 or 1. No overflow if either do. Now test that c > a and c > b? If not, overflow has occurred when using unsigned multiplication. If c is bigger than a and b, overflow …

Member Avatar for deceptikon
0
176
Member Avatar for anumash

> When we want to access a column element i.e s[i][j] in pointer notation this becomes ((s+i)+j) Not quite. Multiply i by the size of the first array dimension. s[i][j] = s[(i*original length of first dimension) + j]

Member Avatar for anumash
0
179
Member Avatar for mc3330418

Inside any function, anything you create on the stack (which is effectively anything you don't make with **new** or **malloc**) ceases to exist when the function ends. So the array you make like this `int upperLetters[26] = {0};` ceases to exist when the function ends. If you try to return …

Member Avatar for rubberman
0
141
Member Avatar for saintjey2000
Member Avatar for andigirlsc

You've made it far harder than it needs to be. Essentially, you need to change the value of current balance 12 times. Something like this: `current_balance = current_balance+(current_balance * INT_RATE);` If you remove starting_balance and ending_balance completely you'll be making it a lot simpler to keep track of.

Member Avatar for Moschops
0
222
Member Avatar for necrovore
Member Avatar for napninjanx

Any text editor than makes just plain text files. Here are some things that would work: Notepad Notepad++ vim emacs

Member Avatar for Moschops
0
2K
Member Avatar for lewashby
Member Avatar for abbashadwan
Member Avatar for nitin1

A char array is just that. Some char objects all next to each other in memory, typically with a zero value on the end. It is up to you to allocate it, keep track of how big it is, make sure you don't write or read off the end of …

Member Avatar for Lucaci Andrew
0
211
Member Avatar for shanki himanshu

`memset(a,1,sizeof(a));` What were you expecting this to do and what did it do? If an int has 4 bytes (or 8 bytes), and you set the value of each byte to 1, what value will the int have? (The answer is not 1)

Member Avatar for Tumlee
0
548
Member Avatar for E.RANJANI
Member Avatar for ramy.merc

What exactly is it that you don't know how to do? Looks like each pSrc points to the image to change, with each pixel taking 4 bytes (I'd guess RGBA), and you have to read those four numbers and turn them into one new number in the greyscale image. Looks …

Member Avatar for Moschops
0
2K
Member Avatar for ztdep

It's a bug in the compiler you're using. It has incomplete to_string support. There should be an update available from Microsoft.

Member Avatar for tinstaafl
0
972
Member Avatar for uzair.tabassumwahla

Is there a question, or would you like us to just point out everything that is wrong with this program?

Member Avatar for Moschops
0
177
Member Avatar for Hopp3r

> However one of the functions doesn't have a length passed with the other parameters! > > `char arrayX(char a[], char v)` > > Where you are asked to find amount of times value (v) is in the array. What (almost) everyone said above is very true; if there is …

Member Avatar for NathanOliver
0
2K
Member Avatar for mayankjain05

> also will the answer be same even i declare the array dynamically?? That just means you don't know at compile time what size it will be, so the memory for it gets allocated during running. Once it's allocated, it's just an array like any other. There's no magic that …

Member Avatar for mayankjain05
0
108
Member Avatar for n@nnouss@
Member Avatar for Asmaa_2

> I want to know how it works?! This code: `someCondition ? someThingToReturn: someThingElseToReturn` works as follows - someCondition is evaluated. If it's true, then `someThingToReturn` is returned. If it's false, `someThingElseToReturn` is returned. So now that you know that, let's look at the condition. `x>='A'&&x<='Z'` So, this will be …

Member Avatar for MandrewP
0
500
Member Avatar for hust921

getopt is a good idea. If it doesn't suit you, what you're trying to do isn't difficult; it just requires you to think carefully about how to actually parse the input. If the structure is to be something like: executableFile -a -b -c someFile -d etc. etc. the solution is …

Member Avatar for hust921
0
233
Member Avatar for samii1017

Do you mean in this line? `printf("Your current weight is %d pounds. You lost %d pounds. \n", weight, weightLostEasyWO);` That line will never be reached because the function returns before that point. Some of your other functions don't return anything at all, you've got int values trying to store what …

Member Avatar for Moschops
0
159
Member Avatar for glenwill101

In C++ they're called maps. A C++ map is one of the standard containers. The C++ FAQ contains this about objects of different types in a container: http://www.parashift.com/c++-faq/heterogeneous-list.html A common approach is to use the boost any library. That said, your example code above doesn't actually store different types. It …

Member Avatar for glenwill101
0
3K
Member Avatar for lewashby

A better question to ask google is "what's the difference between code and data?"

Member Avatar for Ancient Dragon
0
154
Member Avatar for lewashby

It is interesting to note the relationship between log(base 10) of an integer and the number of digits in that integer.

Member Avatar for Moschops
0
107
Member Avatar for Jenniferting
Member Avatar for ailyn.damiles

When you need more than one of some object, and when you need to do something more than once.

Member Avatar for CGSMCMLXXV
-1
78
Member Avatar for Raisefamous

I'm with Ancient Dragon on this, but I go further; I generally recommend that beginners use a relatively simple text editor and they compile/link their code manually at the command line. The number of people who turn up, having been programming for a year, trying to fix an "undefined reference" …

Member Avatar for tinstaafl
0
298

The End.