16,022,205 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by MG2011 (Top 27 by date)
MG2011
1-Feb-12 8:16am
View
Just like that it works:
system("start explorer D:\\Song.WAV");
MG2011
1-Feb-12 7:12am
View
Alright, and how do I do that?:$
I'm sorry for asking so many questions, I'm a beginner:$
MG2011
1-Feb-12 6:51am
View
it gives me this error all the time
[Linker error] undefined reference to `PlaySoundA@12'
What 's my mistake?Now I've changed my code to this:
char soundfile[] = "C:\\Users\\MG2011\\Desktop\\Song.WAV";
PlaySound(soundfile,NULL,SND_FILENAME|SND_ASYNC);
MG2011
1-Feb-12 6:27am
View
Yes I want it to play throughout the programm! Does the file need to be smaller that 1 MB like I've read?Is this right or at least close to right?:$
PlaySound("C:\\Users\\MG2011\\Desktop\\Song.WAV", NULL, SND_LOOP);
MG2011
1-Feb-12 6:19am
View
Could PlaySound() function be useful?
MG2011
1-Feb-12 6:01am
View
Can you show me an example, please? I don't know what to do either with an mp3 or with a wav file!:(
MG2011
1-Feb-12 5:39am
View
Yes that's what I mean...If wav is simpler then I'd better work with that audio format.
MG2011
1-Feb-12 5:28am
View
I 've already downloaded an audio library from this site http://www.un4seen.com/ but I still don't know how to use it!:$
Will it be easier if I convert my mp3 file to another audio format such as wav, or will it be exactly the same?
MG2011
19-Nov-11 9:34am
View
Well I tried sth..it's working but still I have to learn more thingsabout arrays to work with them easier and quicker..!
Here is the code:(I don't know how to make "eleve, twelve...nineteen" show up if they are in the array...I get some very funny results, like tentwo for twelve..lol!!!)
#include <stdio.h>
#include <stdlib.h>
main()
{
char ar1[11][12]={ "","ten","twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" };
char ar2[11][10]={ "", "one", "two", "three", "four", "five", "six","seven", "eight", "nine", "ten"};
int x, y, z;
printf("Give number: \n");
scanf("%d", &x);
z=x/10;
y=x%10;
if (z==0 && y==0)
{
printf("Zero.\n");
goto end;
}
if (y==1 && z==1)
{
printf("Eleven.\n");
goto end;
}
if (z==1 && y==2)
{
printf("Twelve.\n");
goto end;
}
if (z==1 && y==3)
{
printf("Thirteen.\n");
goto end;
}
if (z==1 && y==4)
{
printf("Fourteen.\n");
goto end;
}
if (z==1 && y==5)
{
printf("Fifteen.\n");
goto end;
}
if (z==1 && y==6)
{
printf("Sixteen.\n");
goto end;
}
if (z==1 && y==7)
{
printf("Seventeen.\n");
goto end;
}
if (z==1 && y==8)
{
printf("Eighteen.\n");
goto end;
}
if (z==1 && y==9)
{
printf("Nineteen.\n");
goto end;
}
printf("%s%s!\n", ar1[z],ar2[y]);
end:
system("pause");
}
MG2011
15-Nov-11 10:44am
View
I did it that way!! It's working veeeeeeeeery good... Now i'm gonna try it with arrays...God help me...lol
MG2011
15-Nov-11 9:24am
View
Thank you so much for your answer!!
I tried to compile it but the compiler has some problems with it, which I can't solve...! :-(
Anyway I pretty much understood how it works, and I wanna make a programme that works like that but there are things that I don't know how to use. actualy I don't even know what they are... For example what is this "static size_t GetHundredsWords"?
I will use that as a compass to make sth on my own! :-)
Thank you very much, again, for spending so much time for me..! :-)
MG2011
15-Nov-11 9:18am
View
That sounds ok, I mean I have learnt how to do it so I will try it first, and then I'll try and make it with arrays, (solution 1).
Thank you very much!! (I think I should have thought of that myself!! :-()
MG2011
15-Nov-11 9:16am
View
OK I will try and make an array and I will post the outcome here, so that you can correct my mistakes. Oooh I'm anxious, this will be my first try! Anyway, it is definitely simplier with arrays, that the other way(That creates a loop for every ten numbers) so it's worth trying!
MG2011
14-Nov-11 15:13pm
View
I haven' learnt how to make arrays yet... It sounds simple, but it's still theory to me.
Thanks anyway, though!
MG2011
14-Nov-11 15:02pm
View
I did't think of anything else... :-(
MG2011
29-Oct-11 9:08am
View
So do you think that I should download VS2010? Is that one a preview too?
You are right about it, I should get used to it now because next year we'll be using it at the university!
Thank you so much for your answer and your help! I think that I learned many important things that I will use from this day on..! :-)
MG2011
29-Oct-11 6:08am
View
Yesterday I downloaded Visual Studio 2011, it is free for students! But my professor says that using visual studio for these programmes is like killing an ant with a nuclear bomb!lol
MG2011
29-Oct-11 5:50am
View
Oh I got it, so it is makes 6 look like 00000110, right?
I'm using DevC++ from bloodshed.com and it is fine for the small programmes that I've made so far...! It has a button that says debug, so it must be a debugger as well...!
MG2011
29-Oct-11 5:32am
View
No big deal! (-: One last thing! I read last night that "<<" moves all the bits of my number by 1 place(in this occasion)! But still, when I press 6 which is 110 in binary it doesn't add an extra 0 after that...! That's the only step that I haven't fully understood!(You must be really patient, after all these questions I asked! :blush: )
MG2011
29-Oct-11 4:58am
View
I wrote i<31 and it works for huge numbers as well!
I need to ask you one more thing!
Above you write about "<<":
"Moves the whole number one place to the right"
I thought that this symbol moved it to the left..!
MG2011
28-Oct-11 17:19pm
View
I figured it out!! I wrote i<10 and instead of 128-->512 and now I can also calculate numbers with 10 digits!:-)
MG2011
28-Oct-11 16:07pm
View
Deleted
You are right, with the extra pair of brackets it works just fine for numbers from 0 to 255..!!! You chose the 8 digits by writing i<8 and 0x80?
Thank you soooooo much for everything..!!!!
MG2011
28-Oct-11 12:45pm
View
I wrote that one and now the program runs but when I type for example 6 it says 000000000, and in general it doesn't make a right conversion!:-(
Why does it happen?
I found a program which uses this:
for(i=0; myNumber!=0; i++)
{
bin[i]=myNumber%2;
myNumber=myNumber/2;
}
for(j=i-1; j>=0; j--)
{
printf("%d", bin[j]);
}
and it works but I don't know what that bin[i] thing is and of course i can't show that to my professor!! :-(
MG2011
28-Oct-11 10:44am
View
Thanks for the extra comments! I figured it out and the whole idea is very clever!
The point is that I have to present it to my professor on Monday and if I show him this he will never believe that I did it myself! :-(
Till now we've been coding programmes like "Hello world" and summing a couple of numbers...!
MG2011
28-Oct-11 10:41am
View
I wrote this and although the compiler says that there are no errors, as soon as I type a number it stops working...!:-(
#include <stdio.h>
#include <stdlib.h>
int main()
{
int myNumber, i;
printf("Give number: ");
scanf("%d", myNumber);
if (myNumber & 0x80 != 0)
{
printf("1");
}
else
{
printf("0");
}
myNumber = myNumber << 1;
for (i = 0; i < 8; i++)
{
printf("%d\n", i);
}
system("pause");
}
I'm certain that I've made mistakes, but I can't find them...
Your answer was really very very helpful!!! :-)
MG2011
28-Oct-11 9:58am
View
Thanks a lot!!
I read it many times but I really can't figure it out...
Too complex for me!:-(
MG2011
28-Oct-11 9:57am
View
Thank you very much, I understood this one till a certain point...
What do I write in order to set the loop? I tried a couple of things and althouth I get no error the program writes "0", no matter what number I enter...
And also could you tell me what "myNumber & 0x80" means?Cause i can't understant it..! :-(
Show More