|
I found the problem. It was just a missing const keyword in the function declarations.
Don't bother about it...
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
everything is read but the third word???
aoltimewarnerinc AOL NASDAQ in 26 2674510
citigroupinc C NASDAQ ch 47 149881
cendantcorp CD DOW so 17 174795
ciscosystems CSCO NASDAQ ne 19 629955
generalelectric GE DOW te 37 31010800
intelcorp INTC NASDAQ ch 35 6303500
jdsuniphasecorp JDSU NASDAQ ne 7 281648
microsoftcorp MSFT DOW so 63 3478270
oraclecorp ORCL NASDAQ so 17 523466
qwestcommunicationsintlinc Q DOW te 10 170682
rationalsoftware RATL NASDAQ so 23 387952
sunmicrosystems SUNW NASDAQ so 10 399725
texasinstruments TXN NASDAQ ch 31 146157
tycointernational TYC DOW te 35 6496160
worldcominc-group WCOM NASDAQ ne 10 659215
Roger Daltry 000-00-0001 10000
Ron Howard 000-00-0002 12000
Pete Rozelle 000-00-0003 10500
Dr. Seuss 000-00-0004 10100
Mikhail Gorbachev 000-00-0005 15000
Jackie Joyner-Kersee 000-00-0006 17000
Paula Prentiss 000-00-0007 14000
Andy Gibbs 000-00-0008 18000
Shaquille O'Neal 000-00-0009 16000
Lynn Swann 000-00-0010 18500
S 000-00-0001 C 20
B 000-00-0001 C 20
B 000-00-0002 CD 10
B 000-00-0002 JDSU 50
S 000-00-0002 CD 5
B 000-00-0010 TXN 30
B 000-00-0010 TYC 20
B 000-00-0009 WCOM 20
S 000-00-0009 WCOM 10
|
|
|
|
|
char tempCN[30];
char tempST[30];
char tempMT[30];
char tempTM[2]; You're having a buffer overrun, because the type of manufacturer occupies two characters plus the terminating null character (which gets written on the next available position, namely tempMT[0] ). Reserve more space for tempTM (and as a general rule do not be so conservative when dimensioning things, or better yet, use std::string s).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I found the anwer like 2 minutes before reading your reply
i really appreciate your effort to solve my problem
THANK You so much
|
|
|
|
|
I had this code emailed to me last night and made several suggestions, std::string being one of them. I also pointed out that the NULL terminator takes a space in a char array.
I'm pleased he's changed his mind about posting his code, it will make it much easier to help him.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
i cannot use std::string
because my instructor told us not to.
but thanks though
|
|
|
|
|
It had just occured to me this would be the case. I'm at a loss why they make you learn to do things in a way you never will again, but I guess that just seems to be the way it is done. I learned from a book and learned the whole char* way, and I remember being amazed how much easier it was when I used the string class.
By the way, you need to tick 'display this message as is' when you post code, otherwise your #include statements don't get posted, because the < and > get interpreted as a HTML tag.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
probably making you understand that string is better than char*, obviously, when they discover that there is a string class and something called STL. There are many, many instructors who do not know a thing about STL.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Thomas George wrote:
There are many, many instructors who do not know a thing about STL.
I am not surprised to hear that. Pathetic, isn't it ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
well
i don't think he doesn't know about STL
but he just like to makes our life harder
he thinks that if you want to use libraries, then go program with JAVA
|
|
|
|
|
Marwan wrote:
he thinks that if you want to use libraries, then go program with JAVA
IMO he is a professional idiot if he means not to use libraries for production code. Where would any science be if we were not allowed to benefit from the work done before us ?
I COULD spend my life writing containers and algorithms, but why would I want to ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
As a software engineer, of course I agree with the whole code reuse thing. STL is a spectacular tool that I can't live without.
However, given the type of questions posted here by Marwan, it looks like he/she needs a good solid understanding of the basics of the language before introducing them to the relatively complex ideas of templates. Don't you think?
J
|
|
|
|
|
I understand that std::string is a typedef of a templated class, but would he need to know that ?
I dunno, I'm all for using char arrays early on, but at this point, he seems to have a lot of complexity introduced by virtue of not using a string class. I don't think 'ground up' is always the best way to learn, that's why I am against learning C before C++. You don't need to know about templates/namespaces/etc. to learn C++, you can just find out later that using namespace std; is bad code, and how templates work, etc. I believe C++ is an excellent learning language if you use the facilities it provides and then pull away the supports as you go on to learn the depth of what it can do.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
I've just got a new computer, and I'm using my old version of vc 6 with service pack 5 on windows xp. The problem is that it often pops up messages of this sort...
http:\\joelholdsworth.members.beeb.net\strange.jpg
It seems to popup when I'm altering certain files, or looking at some of the mfc sources. The only way I can get rid of it is to press the cancel button repeatedly for around 30 seconds. This is intensly irritating! Does anyone know the cure? or what its caused by, or has anyone seen this problem, because its eminantly not caused by "\Device\Harddisk1\DR1" not having a disk in it!
With time we live, with money we spend!
Joel Holdsworth
|
|
|
|
|
Well, it's not msdev. We have three people with XP and VC6 with SP5 and everythings ok. I'd check XP out, this sounds rather serious.
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
Sounds more like a problem with XP or the hardware.
Do you get this error with any other software running on the PC ?
Whilst you say
Joel Holdsworth wrote:
because its eminantly not caused by "\Device\Harddisk1\DR1" not having a disk in it!
at that moment in time it maybe that the PC considers that it doesn't have a disk !!
We get a similar message on one of our servers which we believe is connected to the number of buffers allocated to passing data between the disks and the server, so your PC may be timing out in someway when writing to the disk. I would open it up and just check the cables as a starting point.
|
|
|
|
|
Is there a message or some sort of event that I could catch in my app if the machine is running low on virtual memory ?
Cheers
AndyC
|
|
|
|
|
It's a little complicated but you can use VirtualQuery();
Regards a Good Luck...
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Compiling...
main.cpp
C:\Windows\Desktop\DataStru\main.cpp(91) : error C2601: 'setInitialValue' : local function definitions are illegal
C:\Windows\Desktop\DataStru\main.cpp(96) : error C2601: 'setcurStockPrice' : local function definitions are illegal
C:\Windows\Desktop\DataStru\main.cpp(101) : error C2601: 'setmanufCompany' : local function definitions are illegal
C:\Windows\Desktop\DataStru\main.cpp(106) : error C2601: 'setNumOfOutShares' : local function definitions are illegal
C:\Windows\Desktop\DataStru\main.cpp(111) : error C2601: 'setTypeOfManufactr' : local function definitions are illegal
thank you
|
|
|
|
|
Show me teh definition fo those functions...
Reagrds
Computer analyst to programmer: "You start coding. I'll go find out what they want."
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Post some code.
Jon Sagara
What about ?
|
|
|
|
|
Seems that you tried to define setInitialValue etc. inside of main(). Move them to the global space, and it should be OK
I vote pro drink
|
|
|
|
|
seems like you have done something similar to this:
void someFunction(...)
{
void setInitialValue(...)
{
...
}
...
} this is illegal C++. Move the setInitialValue (and all the offending functions) outside their enclosing functions.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
rumble rumble
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Your answer was better, but I was faster
I vote pro drink
|
|
|
|