"val" is just a pointer to some variable that we either populate with "source" if it's valid or populate with "default" if "source" is not valid. The variable pointed to by "val" is sometimes a float...
Type: Posts; User: Loctan
"val" is just a pointer to some variable that we either populate with "source" if it's valid or populate with "default" if "source" is not valid. The variable pointed to by "val" is sometimes a float...
We have a structure defined something like (it does a lot more than this, but this is all that's necessary for my problem):
typdef struct
{
some_data_type source;
Can anyone tell me the difference between:
float answer = 3.0f;
I did a search and someone posted a very similar question on Daniweb last April. It most definitely is HW.
#include <iostream>
int main()
{
int num = 0x1111;
for(int i = sizeof(int)*8-1; i >= 0; i--)
{
Thanks for the explanations guys. I have never had the opportunity to take a compiler course so I wasn't sure of all the details of this. Hopefully I can take one soon. For fun, if I get bored at...
int * pointer = (int*)0x100579C; //ERROR ZONE
"0x100579C" is an integer. You need to cast it as a pointer to an integer. e.g, (int*)
I understand about the whole
Blah.h
ifndef BLAH_H
#define BLAH_H
Please format your code and post what your program does along with the errors.
[edit] After pasting your code in Dev C++ I think you will see many of your errors. Your braces are out of place.
I would like to help you, but you indentation stinks. Your code is barely readable. Instead of this:
while((d1!=0)||(d1=a1)||(d1=b1)||(d1=c1)){
d1=rand()*5/32768;
if...
I am not sure there are necessarily hard and fast rules for this, so this is more than opinion (to a large extent). Consider this hypothetical program. Suppose you have an address book and want to...
A binary search tree will provide logarithmic searching which is pretty good. Insertions or deletions will be more costly because they may require some tree rebalancing.
For your linked list, are...
I really didn't check the logic, but it compiles and runs if you get rid of:
int v;
You don't use it. v is already declared as a vector.
You need to include the vector header since you...
Sweet. Thank you very much.
I want to use a string stream to convert an int to a string, then a string to an int use the same stringstream. If I declare two like this, it works fine:
#include <iostream>
#include...
Thanks for the help.
Nice work. I have done some work with AutoCAD and Mechanical Desktop. Making the individual parts usually isn't too bad, but piecing it together can be quite difficult.
I think this is what you are looking for. In particular lesson 13.
http://www.functionx.com/win32/index.htm
That may be a poorly worded title, but this is what I am confused about. The only online reference I use for C++ is this website:
http://www.cppreference.com/
When I look functions up, it...
After looking through it, you need to start over IMO. You are using goto statements, have random braces and this isn't even C++. It's C.
I will be up late tonight so if you want to post your...
I pasted your code and it doesn't even compile.
Can't you use getline to get the string and then just access the first two characters by saying:
stringName.substr(2);
http://www.cppreference.com/cppstring/substr.html
You can test it yourself by downloading Dev C++. you don't have to be in your lab.
transform(answer.begin(), answer.end(), answer.begin(), ::tolower);
Converts the string from uppcase to...
If I were you, I wouldn't worry about using pointers to character arrays. I would just use strings.
Someone posted this here awhile ago and I think it might help you:
// An improved version...