|
http://www.codeguru.com/forum/attachment.php?attachmentid=24629&d=1238668433[^]">
|
|
|
|
|
Is your program logging? If not, it's time to log in VERBOSE mode. With logs, or something as simple as a Debug output viewer[^] can work magic, can't it? At the very least, message boxes here and there? You first need to find out to what point the code reaches. Then you would know where it breaks.
If you can't figure this stuff out sitting right before the code, I think it must be difficult for the rest of the people on this forum with the details that you've given.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Do you have some aversion to that "debug" button?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Its pointing in dgbhook.c file. its not giving any line number.
|
|
|
|
|
I guess it's an excellent opportunity to learn how to use your debugger . Since all the time you are posting here, you never used your debugger ?
|
|
|
|
|
Sssh! Don't tell him about the callstack.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: callstack
Oh, you mean telephone support and how many calls are waiting?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I'm trying to incurment my array of inputs while the loop goes around
example
int num=2;
int array[1,2,3,4,etc];
for(int l=0;l<num;l++){>
do this etc}
how do i incurment the array as the number changes??
hope i've made my question clear
i.e. the num determines how many of the array values to take in
Any help would be much appreciated thanks
|
|
|
|
|
I don't get a clue of what you're talking about. Rephrase, perhaps?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
k i'm writing a sound synth but that's not the bit i'm having a problem with....i need to take in values from the user such as how many frequencies they want to play and then what freq's they choose..so i want my program to run as many freqs(num) then to incrument what stored in the array ie. the actual frequencies..
<pre>
num=3;
input[220,440,660];
freq=input[i]
for(l=0;l<num:l++){
osc(buffer,amp,freq,wave,&ndx);
soundout(psf,buffer);
}
</pre>
the user input is workin and the synth is working but i can't get the other freq's in the array to play it's just picking up the first one...
hope this is better
|
|
|
|
|
Jacavienna wrote: osc(buffer,amp,freq,wave,&ndx);
What is "buffer", "freq", etc., Simply, what is that you want?
Jacavienna wrote: input[220,440,660];
What's that?
I think I'm almost done with you.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
there's alot to it lol....it's just controls for the synth....
if you still wanna know send us a message and i'll send you the stuff you need to make it work ie soundio.cpp oscil.cpp and ftables.cpp these all make up the definations of the synth i'm just using them..
|
|
|
|
|
So...you get num from the user. You want to allocate an array of that size, then get num values from the user and put them into the array?
This should do:
#include <stdio.h>
int main(int argc, char** argv)
{
int num;
printf("Number of frequencies?\n");
scanf("%d", &num);
int* freq = new int[num];
for(int i=0;i<num;++i)
{
printf("Frequency %d?\n", i);
scanf("%d", freq+i);
}
delete[] freq;
}
As Cedric said, you're probably better off using std::vector .
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Select "Ignore HTML tags in this message (good for code snippets)" from the bottom of your screen so that we are able to see the code in proper way.
Secondly, you can ask the user to input a number, say "num". Now you can loop upto num times.'
I hope I read your question correctly
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
If you are talking about dynamic array
means size of array get change at run time
then you can't declare array this way.
You have to take pointer of int array
And use melloc & realloc method for dynamic allocation.
If this is not what you are asking then please clarify your question.
regards,
Divyang Mithaiwala
Software Engineer
|
|
|
|
|
cool thanks a mill for responding....i don't know much about malloc (tho we did touch on it in class)....
thing is the loop in working and it's sending the amount of freq but not the values...i have the array set at [44] so the user shouldn't go out of bounds....so your saying this won't work ...is there any other way?? ie without using malloc...assignment is in at 4 today so i don't have time to look into how malloc functions ....what i have should be enough but would be better if i could get it to play multiple freqs .... thanks again
|
|
|
|
|
If you want a dynamic array, I suggest you take a look at a std::vetor.
|
|
|
|
|
hey i have the std::vector function but what do i need to access it ie where does <pre> #include <vector> </pre> come from? do i need to download something??
|
|
|
|
|
Jacavienna wrote: std::vector function
It's not a function, it's a class (template).
You have to #include <vector> . Here[^] is a small guide to get you started with the STL. If you are still stuck after that, try googling for vector tutorials.
|
|
|
|
|
Jacavienna wrote: how do i incurment the array as the number changes??
array[l]
Check out the subscript operator.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
i need a application which carry all desktop setting means folder and files ,
which carry my documeunt and any personal data and go to any guest pc and do any updation there and come back in you pc and sync and you found all updation there .give a sample like that
or can any body help me
|
|
|
|
|
How much are you ready to shell out of your pocket?
AshNis wrote: i need a application which carry all desktop setting means folder and files ,
which carry my documeunt and any personal data and go to any guest pc and do any updation there and come back in you pc and sync and you found all updation there .give a sample like that
wow! the application goes to guest pc, does the updation and come back to your pc.... interesting
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Live Mesh[^]
May be of use to you! I've not used it myself, but I hear good things about it...
Or a memory stick?
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Hi,
I have created CStatic object in my MFC application.I have allocated memory to it.If I delete static variable It is giving breakpoint.I am unable to delete CStatic object.Can anyone help me.
|
|
|
|
|
What do you mean by "It is giving breakpoint"? Do you mean that it is failing an ASSERT? If yes, where and what?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|