|
I'm so confused it's not even funny...I swear this probl;em is unsolvable...
jk
Anyways...here it is...
I have three integer indexes stored in an associative array
arr["MONTH"] = 12;
arr["YEAR"] = 3;
arr["DAY"] = 0;
I need to some how sort these indexes now, but sorting is not an option...
I need to basically convert each index value into it's element index inside the array...
Do I make sense???
The numbers above would become:
arr["MONTH"] = 2;
arr["YEAR"] = 1;
arr["DAY"] = 0;
Each element may be any number, except for the same as any other...there will never be 2 10's, etc...
Here is what i've tried to use thus far, but it makes no sense...
var max1 = Math.max(this.m_arrIndex['MONTH'], this.m_arrIndex['YEAR']);
var max2 = Math.max(this.m_arrIndex['DAY'], this.m_arrIndex['YEAR']);
var max3 = Math.max(this.m_arrIndex['DAY'], this.m_arrIndex['MONTH']);
Remember sorting the array is out of the question...
Anyone care to shed some light on this subject for me...possible solve it for me
It's really driving me nutts...
Thanks
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
I've managed to get an adhoc hack working, but it's not very elegant...
No answer is need now, unless you know of some short and sweet approach...
Thanks
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
Can anybody tell me how to get SCSI Hard disk's serial number. I got for IDE Hard disk's but not getting for SCSI HDD.
So please help me for the same.
Thanks in advanced
|
|
|
|
|
|
Hi,
I want to simulate some printers by using their MIBs.I'm planning to use Agent++ created by HP. Is there any better way of implementing SNMP agents? Please tell me the best technology used to develop SNMP agents. Cross-platform compatibility is an issue. So I have no idea of using WinSNMP.
Thanks,
Dipeka
Dipeka.A.J
|
|
|
|
|
Hi all:
Does anyone knows how's the files order appearing after the DOS command "dir" the way it is, it depending on what? How can I specify that order with my intention through coding!
thanks
|
|
|
|
|
again ?
dir list files alphabetically by default.
In your command window, type "help dir" to see the different switch that can be used to sort the list of files.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hi, buddies.
I used own-draw control here for commercial use. I fear about License problem. Any one can give me a tip?
please contact:
max_xiayi@hotmail.com
|
|
|
|
|
|
hello
I search effect audio in C++:
- echo
- reverberation
- chorus
- flanger
- delay
- ....
I'm interseting if you know where I can find all this.
Thank you very much
|
|
|
|
|
|
Hello
Yes. I already tried this. The problem is that it doesn't work. The project doesn't compile. There are erreur.
- error C2146: syntax error : missing ';' before identifier 'dwReserved1'
- error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
- error C2501: 'dwReserved1' : missing storage-class or type specifiers
- error C2146: syntax error : missing ';' before identifier 'dwReserved2'
- error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
- error C2501: 'dwReserved2' : missing storage-class or type specifiers
- fatal error C1189: #error : "The sample framework requires a Unicode build. If you are using Microsoft Visual C++ .NET, under the General tab of the project properties change th
#ifndef UNICODE
#error "The sample framework requires a Unicode build. If you are using Microsoft Visual C++ .NET, under the General tab of the project properties change the Character Set to 'Use Unicode Character Set'."
#endif
May be a library is missing, but I don't know.
thank you
|
|
|
|
|
Maybe I'm missing something, but it looks to me like you've just answered your own question. DirectX 9 (according to a quick google search) requires Unicode builds. Either set the project as a Unicode build in Visual Studio like the 'fatal error' is trying to tell you to do, or just #define UNICODE at the top of your project somewhere.
Marcus Spitzmiller
"Why must life be so hard? Why must I fail at every attempt at masonry?" - Homer
|
|
|
|
|
|
Hi folks,
I've just got stuck on the following issue, easy-looking at the first glance:
I've got a char variable and I need to output its value as a number making use of << intrinsic ostream insertor. But a character appears as the result on the output instead of number, and it seems there is any suitable manipulator in ostream to force the insertor to translate the char value as a number.
In C, I can write:
unsigned char X = 65;
printf("%c\n", X); // the result is character 'A'
printf("%u\n", X); // the result is number 65 - and that is what I need
But, in C++:
unsigned char X = 65;
cout << X << endl; // the result is character 'A'
// ??? How to output number ??? without necessity of casting to int ...
Thanks a lot for any suggestion, Petr.
|
|
|
|
|
What about cout << (int)X << endl; ?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi all:
Recently I've finished the coding of a tiny function which is to specify the files(Mp3s) order (by which the one appear first can be played first in the Mp3 player, this order depending on the result of DOS command "dir").
I'm not familiar with file system, after a little research, I found that the order in which you copying file to the destination folder(Mp3 Player Destination drive) is the order that the mp3 will played. So I implemented the code according to this principle. I was excited to found I really can control which mp3 should be played first. But after a little testing I found that this principle is not running stable, It will out of order once in a while.
Finally I decided to turn to another alternative which is FDT(File Directory Table). I heard from some guys that FDT can decide the file order either but much at low level.I wish I could write to the FDT of each file such that to achieve the objective. Can anybody provide the principle of writing to FDT or totally different method to affected the file order?
really appreciated !!!;)
|
|
|
|
|
didn't you just posted that ?!!?!
anyway ...
me think you are making your life difficult ...
just use FindFirstFile/FindNextFile in your mp3 folder to load the file into a list and sort it internally in your program.
let the user decide how to play the files.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Does anyone know if you need Unicode strings to store Turkish characters? I thought it wouldn't be necessary because ASCII works with normal European characters (e.g. ñ, é), but I am having some problems with the special Turkish ones (e.g. ğ, ş, ı )
|
|
|
|
|
ASCII includes only the characters a-z and A-Z, for anything else (like ñ or é) you need either Unicode or one of the 8-bit ISO character sets. You could use ISO 8859-9 character set for Turkish, but then you must include the information about the character set in use somewhere in the data. Unicode is better because it's not ambiguous. See this article: http://www.joelonsoftware.com/articles/Unicode.html[^]
|
|
|
|
|
Thanks for you answer, that makes things very clear.
Ed
|
|
|
|
|
Hello,
I'm looking for suggestions on how to design an text input file. I imagine that each line of the file would look something like this:
Operation argument1 argument2 argument3 etc.
I understand how to do file input if you just want to read one word at a time using the >> operator, but I'm not sure how to "check" what the incoming input is. For example, if a line in the input file started with the operation "CreateNewAccount", how do I (programmatically) check what the string says? If I use std::string for the input the >> operator doesn't seem to like it. If I use char arrays, I can't seem to get two strings to be recognized as equal.
Thanks you for suggestions for how to do this, or perhaps for better ways to go about it. If there is any part I need to clarify let me know.
-Jordan Atlas
|
|
|
|
|
To be more specific about the problems I was having:
I wanted to try to read the words into string variables so that I could compared them to strings indicating which reaction they correspond to. However, if I try to read the words into std::string variables using something like:
inFile >> tempString;
then I get a compiler error:
error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >' (or there is no
acceptable conversion)
I also tried reading the words into char arrays so that I could comapare the char arrays to the string corresponding to a particular operation. If I do that, however, then the comparison doesn't seem to work. Ie: If I read the word "Account" into a char array called charTemp, the statement (charTemp == "Account") seems to evaluate to false (even tho my intention would be for it to be true).
I hope that clarifies the problem rather than making it more complicated!
Again, I am open to alternative suggestions.
-Jordan Atlas
|
|
|
|
|
Jordan C. Atlas wrote:
inFile >> tempString;
then I get a compiler error:
error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class std::basic_string,class std::allocator >' (or there is no
acceptable conversion)
#include <string>
Jordan C. Atlas wrote:
the statement (charTemp == "Account") seems to evaluate to false
You are comparing two pointers that point to different things so they are obviously not equal. To compare the contents of char arrays you have to use strcmp() .
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Thank you - your answer makes sense. I will continue writing the input file using strings.
-Jordan Atlas-
|
|
|
|