|
File menu, Symbol File Path... menu item.
Set the directories in this folder and select reload.
|
|
|
|
|
Hello, I am fairly new to programming and I am curious...
I built a small 5 line program that asks me what I typed in, followed by echoing what I typed in... if I insert a number with more than one decimal, I can't get the same result that I typed in.
I've used int, long, double, float for my variable.
Can anyone put me on the right track? Thank you
---Mike.
-- modified at 11:02 Friday 28th October, 2005
|
|
|
|
|
|
As soon as you put a second decimal whay you are typing is no longer a number. It becomes are char string.
|
|
|
|
|
Not necessarily. Some areas use . as the digit-grouping symbol and , as the decimal symbol.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I didn't think of that.
But aren't they still invalid character's for an numberic type.
For example: enter 1,000.00 into a float is invalid because the ',' is not a valid. It should be entered as 1000.00
I would expect that in alternate notations such as 1.000,00 the same validity would be expected.
|
|
|
|
|
If you entered 1,000.00 in code, it would result in a compiler error. If you entered the same thing in a masked edit control, it should be acceptable. It appears to me mtucker6784 is working with user input of some sort.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I assumed a simple fscan type operation since he said he was a beginer and it was a 5 line program.
|
|
|
|
|
Here is what I'm looking at
"
#include <iostream>
#include <windows.h>
using namespace std;
float ipad;
void main() {
cout << "What is my ip address?\n";
cin >> ipad;
cout << "I typed in\n";
cout << " " << ipad;
}
"
I'm not sure what an fscan function is but I'll look around the site and see how I can use it. I'm using the ip address situation as an example of having more than one decimal. In reality, I'm just trying to understand how this all will work. Thanks in advance, --Mike
|
|
|
|
|
mtucker6784 wrote: I'm not sure what an fscan function is
It's called fscanf() . It allows reading formatted data from a stream. To read formatted data from the keyboard, you could use scanf() , like:
char a[4], b[4], c[4], d[4];
scanf("%[0-9].%[0-9].%[0-9].%[0-9]", a, b, c, d); I would not recommend this, however, as there is no way to check for bad input.
SInce IP addresses are strings, even though they happen to contain dots, what you are using will work if you change ipad to a string type rather than a float .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I have an edit box which people text many lines of text into.
Lets say the text is:
Danielle Brina
Suite 1
I want to get each line of the edit box, so I have:
int i, nLineCount = pmyEdit->GetLineCount();
CString strText, strLine;
for (i=0;i < nLineCount;i++)
{
// length of line i:
int len = pmyEdit->LineLength(pmyEdit->LineIndex(i));
pmyEdit->GetLine(i, strText.GetBuffer(len), len);
strText.ReleaseBuffer(len);
}
But what happens is the first line looks like:
Danielle Brina
and the 2nd line looks like
Suite 1e Brina
which is a combination of the two. I tried adding strText.Empty();
as well as other commands, but I cant get the two lines to stop
blurring. Anyone see an obvious solution?
Please, any response any one can give me will be greatly appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
GetLine does not append a NULL terminator to the end of the string, so you have to insert a NULL at the end of the line yourself.
int len = pmyEdit->LineLength(pmyEdit->LineIndex(i));
LPTSTR Buffer = strText.GetBuffer(len + 1);
pmyEdit->GetLine(i, Buffer, len);
Buffer[len] = NULL;
strText.ReleaseBuffer();
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hi Friend,
I want to create a link list using STL. I am doing the following
-----------------.h file---------------
struct CNode
{
long x;
_bstr_t b;
_bstr_t c;
};
class A
{
...
typedef std::list<CNode* > SEC_MSG_DATA;
SEC_MSG_DATA node;
...
}
--------------------------------------------------
I am trying to acces the member of the structure CNode through the object pointer of class A (pA->node.x) however i am getting the error message
<x is not a member of 'list<struct CNode *,class std::allocator<struct CNode *> >
Can you please help me.
Thanks
-- modified at 11:39 Friday 28th October, 2005
|
|
|
|
|
please edit your post, put the code between <pre></pre> tags, and use the buttons "<" and ">" at the bottom of the edit field to let us see what you put in your list.
moreover, please give us the entiere error message and the related code that is crashing.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
how do you access the node please (give me some real code that's accessing it !)
consider using iterators...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
using iterator i can get the store data however i have to fill the member of structure first.I have made some change in the code above.
|
|
|
|
|
why not you create a vector of your Class type?
for example,
class YourClass
{
public :
int i;
int a;
}
YourClass mObj;
vector<yourclass>vec1;
mObj.a=100;
mObj.i=45;
vec1.push_back(mObj);// consider this object as a Node.
and even you can define your own functions in the class to navigate or search a node. will this work?
--[v]--
|
|
|
|
|
If you see i am doing the same thing instead of using class i am using structure to store in list. Only problem i am facing i am not able to access the member of that structure.
|
|
|
|
|
thatz y i'm asking u to consider using a class. i'm still not sure what'd be wrong. but i dont find any problem using the below code.
for(i=0;i<vec1.size();i++)
{
cout<<"\n";
cout<<vec1[i].a;
}
--[v]--
|
|
|
|
|
you cannot access members of a std::list like you would do in a normal C/C++ linked list.
you need to create an iterator to access each item in the list :
( untested and unverified code ... )
<br />
typedef std::list < CNode* > SEC_MSG_DATA;<br />
...<br />
<br />
SEC_MSG_DATA::iterator it = node.begin();<br />
CNode* pNode = *it;<br />
to traverse the list, you can do something like :
<br />
SEC_MSG_DATA::iterator it = node.begin();<br />
while ( it != node.end() )<br />
{<br />
CNode* pNode = *it;<br />
<br />
++it;<br />
}<br />
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
yeah we can. I just resolved the problem however thanks to all for showing interest in my issue.
|
|
|
|
|
Hello people,
I am trying to setup an VC++ and VB application on my machine, which is visual stuido.net 2003 enterprise edition. When I install the application I am getting the following error. Debug Assertion Failed "File: Ctlreg.cpp Line:520". Anybody have idea about this kind of error and how to resolve this? I just searched this file on my machine and found two versions. Is this related to this?? If anybody having clue suggest some solution.
Regards,
Satya
|
|
|
|
|
I want to show my Internet Explorer toolbar in Internet Explorer programatically (meaning that after installation the user does not have to access the "View > Toolbars >" in order to display the toolbar). I remember I read somewhere about how you can acomplish this, but cannot find the link anymore.
Anyone care to share some light on this matter?
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
hi,
I am writing a C++ App for for windows, It is a very time critical application and I seem to have a problem when paging is necessary (that was a long debug session).
The server running the program does have any memory problems, it runs on 2GB of RAM and has no other job except that program.
I am using WIN32 API HeapCreate and HeapAlloc functions.
Is there any way to keep the Heap (a few MB) in the physical memory?
|
|
|
|