|
One solution can help you to make something new:
class Array2D
{
public:
Array2D(int w, int h):width(w), height(h), array(w*h) {}
... ...
protected:
int width, height;
Array array;
}
template
class Array3D :public Array2D
{
public:
Array3D(int l, int w, int h)
: Array2D( w, h), length(l)
{}
... ...
protected:
int length;
//Array< Array2D > array;
}
|
|
|
|
|
does anyone know how to take a sample signal from a wav file? thank you
|
|
|
|
|
What did you mean by sample signal? Did you mean the sample rate?
- NS -
|
|
|
|
|
You need to know the format of a WAV file. Here's an example:
WAV File Format[^]
Using the format you can work your way through the file to the samples.
If the samples are compressed, you can use the Microsoft
Audio Compression Manager[^] or some other method to uncompress
the samples.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm beginning C++. When I put a year, it calculate a month and day (ex. 5 23) for a particular holiday.
How do I convert these numbers into words. (ex. March Twenty Three)
Am I suppose to use individual functions or if-else statement? How is it done?
Thanks.
|
|
|
|
|
The simplest way that you can done easily is using an array.
Eg:
char* sMonth[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
cout << sMonth[nMnth];
But for the date, it is costly, but you can use...
I suggest implement a logic for the date.
- NS -
|
|
|
|
|
Is there another way, perhaps functions or if-else statements?
Our class haven't learned about arrays yet.
|
|
|
|
|
I see...
I think you are seeking for a logic using if-else or functions, right?
Well...
char* MonthToStr( int n )
{
if( n == 1 ) return "Jan";
else if( n == 2 ) return "Jan";
else if( n == 12 ) return "Dec";
else return "Invalid";
}
main()
{
char* s = MonthToStr( 1 );
}
- NS -
|
|
|
|
|
i think u should use switch() and case to print words
ya its little bit lengthy
i dont know about any function for this
|
|
|
|
|
hey, this is a huge task.
if you're really beginner, don't you have anything easier to start with ?
|
|
|
|
|
My prof. assigned it too me. I know this crap is hard. The first 2 assignment was a piece of cake, but the third I'm really stuck on. he never showed me how to convert number to words before.
|
|
|
|
|
ahh, so, it's a homework, and you want us to do it for you !!?
no way dude !
do it yourslf first, then if you have problems with the code you posted, post specific question about it, but never expect people to do the job for you.
|
|
|
|
|
I'm doing the best I can do my own homework, I've read over 40 pages in my textbook today trying to figure this sh*t out. And I'm stuck. Looking at your recent post, you seem to be interested in putting people down or posting useless messages.
What do you think tutors are for? Helping with their homework, not doing it for them. And I need a tutor!
I'm not asking people to do my homework. If you can't help, don't say nothing.
|
|
|
|
|
correction sir.
i'm a major member of this site, and no, i'm not always pulling people down. i'm doing this only when i'm judging it's necessary; and that's the case here.
moreover, as you're talking about "tutors", you have to know that no one is paid to give answers on this forum. we do it for pleasure, but if to OP is not doing it's own tests, no one will do them for him...
|
|
|
|
|
you think being a major member of the site makes you better? 8 out 10 of your post are junk. the people you are judging seems to be the beginners, if you believe beginners threads are irritating or stupid than let it be, you don't need to post. I've seen plenty of great helpers here and your not one of them.
|
|
|
|
|
MoboTech wrote: you think being a major member of the site makes you better? 8 out 10 of your post are junk
what makes you think so ?
being a member for 20 days ?
crap !
i have nothing more to argue with you, stupid kid. go to you class, and learn what your teacher teaches you.
only then, if you have a technical question, then i'd be glad to help you, but only if you show that you tried a bit by yourself.
|
|
|
|
|
So what people say is actually true... French are asses! Your no help in this forum. I've got so many great helps from others and I thank you, but yours is below helpful. toxcct should be demoted.
|
|
|
|
|
OMG! I missed to read this.Well then, you should ignore my previous message. That was meant for someone who shows respect for others. You need a stronger treatment. , Ok, read my previous message again.
Jemmy : Deadline? Pfft, a real programmer eats deadlines for breakfast. :P
Mark: I thought real programmers ignored deadlines
Best wishes to Rexx[^]
|
|
|
|
|
MoboTech wrote: So what people say is actually true... French are asses! Your no help in this forum. I've got so many great helps from others and I thank you, but yours is below helpful. toxcct should be demoted.
Oh, I'm sure you'll be getting a lot of help here in the future.
Really, don't get pissed off if we don't do your homework for you. I only posted my link because it was already there (you could try doing a search you know) and took me like two seconds. I wouldn't have gone out of my way for your homework either.
And here's something funny, try COMMUNICATING with your professor about it. Maybe he'll give you pointers. I know it's crazy, but sometimes using your mouth for good works too.
|
|
|
|
|
Dude - this site has been around for a long time. Coming here in the hope that we'll help you when you can't make sense of your course materials ( which will be enough for you to do this, by definition ), and hoping simultaneously to start insulting the people who try to help you, is not very smart.
I recommend that you read your homework, and think the problem through. It's kind of trivial. The relevant code has already been posted on this thread. You need to break your date into parts, and then check those parts to convert them to words. No direct conversion exists, you need to find, for example, 31, and replace it with 'thirty-one'.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If you look at my above post, I'm actually thanking the people that helped me. I've posted two threads here today, each has a post by toxcct and they were rude comments.
But thanks any ways.
|
|
|
|
|
But he has done a lot of good works to help the beginners come up here. Even I'm one of them. So if you don't know someone completely, just don't comment seeing a few strong messages from them. Yeah he needs to be tough! expects so much of disciplines in the forum. Without him, I'm sure the forum would look a little degraded. He has certainly helped to filter out a lot of stupid questions. Getting his strong comment, one would be afraid to post a similar one next time. He wants the problem to be explained properly,but that doesn't mean that he is required to answer every question that he had asked to be proper. That would atleast help someone to understand the problem better and give a definite answer to it. So either ways he's helping the forum to keep a neat line. It's very unfortunate that you've just joined the forum and talking so rude against a senior member of the same. Anyway I wish you'd get the point and have a nice stay.
Just f*ck off.
-- modified at 10:45 Wednesday 26th September, 2007
Jemmy : Deadline? Pfft, a real programmer eats deadlines for breakfast. :P
Mark: I thought real programmers ignored deadlines
Best wishes to Rexx[^]
|
|
|
|
|
MoboTech wrote: I'm doing the best I can do my own homework, I've read over 40 pages in my textbook today trying to figure this sh*t out. And I'm stuck.
There's a 99% guarantee that you will not find a chapter titled How to Convert Numbers to Words in said textbook. The only reason I did not use 100% is that there's a chance that some author might use that as an example, but it will never be the focal point of any chapter.
MoboTech wrote: Helping with their homework...
And what have you tried thus far, even if it failed? Remember, Thomas Edison did not improve the light bulb on his first try. He first had to find 1,000 ways that did not work.
MoboTech wrote: If you can't help, don't say nothing.
Easily, Tox can do your homework in all of five minutes, but he's smart enough to know that that won't help you one bit.
All that aside, what was wrong with the suggestion from NS17?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
MoboTech wrote: What do you think tutors are for? Helping with their homework, not doing it for them. And I need a tutor!
I'm not asking people to do my homework. If you can't help, don't say nothing.
I guess the difference is how you ask the question. First such answers are easily googleable. Second if you need a tutor rather than the answer, admit it up front. You'll get far less guff about it than if you admit later it is a homework assignment after someone has done the work for you. And you will get a better answer from one of the regulars demonstrating the methods without giving you the answer. You'll learn more and be more capable of a programmer.
Half of programming is learning where to find the answers. It doesn't matter if you have been programming 1 month or 10 years, you will find something beyond your skill on occasion. What you do and how you do it shows your character and skill both. Thus the trouble you are getting from a few members (and you are actually lucky you got the answers). Some people are interested in getting the vote and giving you the answers because they want to get enough votes to be MVP. They are hurting you for their own benefit. Eventually you will not have them to give you an answer, so how do you find the answer?
A tutor teaches you how to fish so that you can catch your own meal, not hands you a fish. So far I have seen no one showing you how to fish. I am sure you are overjoyed at that now, but eventually you will not have that person to turn to, and you will be lost. No guff from me, only a word of caution: you are only hurting yourself. Next time ask for some one to give you the technique without the answer. One of the regulars, or even one of the MVP wannabes will help you in a way that benefits you, not them.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
MoboTech wrote: I know this crap is hard.
No it's not.
And that's not an insult - it really isn't. You have a classic assignment - it shows up in the first couple of weeks in hundreds of textbooks and courses based on them. And you've been assigned it to teach you something. Of course you can just pull the answers off of a web site, but then what have you learned?
And so i repeat, it's not hard. But if you don't spend the time learning from your course work, you'll find the hard tasks impossible when eventually you do encounter them.
Just a fair warning...
---- I don't care what you consider witty, but at least I do not blather on posting nonsense like Jim Crafton.-- Stringcheese, humbled by Crafton's ability to string together multiple sentences
|
|
|
|
|