validating the value in a integer...? [closed] - c++

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
how do v find a value in an integer is garbage or not???

Initialize it at point of declaration, and it can never be garbage.

Pass it to strfry and compare the returned value with the original.

I guess that you mean if a string contains a valid integer. Check out scanf or the stream equivalent of c++, or Boost lexical cast

Related

Why does Qt use arrow syntax? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
Is there a reason why Qt decided to replace the . with ->? Is there a technical reason why we do:
ui->statusBar->setSizeGripEnabled(false);
instead of
ui.statusBar.setSizeGripEnabled(false);
?
This isn't a choice of Qt, but the way proper design in C++ works. -> dereferences a pointer to an object to access a member of it. Passing a pointer around tends to be the cleanest method of access to an object.

c++ conversion const member [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a member L that is a list of pairs of ints which I would like to use in a const function. I'm hence not supposed to modify L, but I don't know how I can iterate through L, to read its contents (as opposed to modifying them).
The compiler keeps saying there is a conversion issue.
Assuming you are using std::list<std::pair<int,int>> you need to use std::list<std::pair<int,int>>::const_iterator as the type for your iterator.

C++ Program Required with arrays [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I want to write a program which will show the numeric value of odd, even & zero values in array. The problem is that when I input values in array, C++ compiler doesn’t view the result and finishes the output window . Is there any solution for this?
Assuming you mean why the console window closes, you can add cin.get() to the end.

about pointer and reference [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a pointer *p and a reference &s. I would like all the values that s contains to be copied by p. How can I do this?
Need some code example. THX
Your question is a lot less than clear. But for now, I'll give you this:
*p = s;
If this doesn't answer your question, then you need to clarify exactly what you're after.

C++ "infinite" length text [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
my task is to make a program that can store arbitrary long text in c++.
I have no idea how to solve this.
Also, you cannot use STL.
someone please help
allocate initial buffer (malloc())
store data into buffer until full (strcpy(), strcat(), memcpy()...)
reallocate to a bigger buffer (realloc())
goto 2