|
Been reading too much lounge.
I read that as:
Worm regards...
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 all,
I am getting a Microsoft Visual studio C Runtime Library error and that error is showing its cursor in dbghook.c file.
My problem is, when i debug my program it doesn't give any error and when i run it directly its giving an error.
How can i remove this error.
Thanks in advance
|
|
|
|
|
What error?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Microsoft Visual studio C Runtime Library error
|
|
|
|
|
An error or an assertion? If that's an assertion, isn't there the filename and line number where the assertion is happening? Haven't you checked that? You are running a debug build or a release build?
I don't see how can you expect anyone to help you without providing any information that would be of use at all.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
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
|
|
|
|