Woww nice to see it working, else I was always finding some warnings.
You showed some of the very important ways of dynamically allocating arrays. Seems like you are very much well versed with this...
Type: Posts; User: rakeshkool27
Woww nice to see it working, else I was always finding some warnings.
You showed some of the very important ways of dynamically allocating arrays. Seems like you are very much well versed with this...
Hey that was really great.
It works fine and thats the best way.
Thanks for the code.
I tried around that but I had gone one thing wrong.
LR = (int*)malloc((2*M)*sizeof(int));
Suppose for the case of standard notation of arrays, what do you mean by one malloc for the array of pointer to arrays??
Does it mean this:
LR = (int*)malloc((2*M)*sizeof(int));
Okay let me explain the situation.
In my program there is a part where I need to take user input of a left boundary and right boundary,thats why the name LR.
So this 1-D array will always be of 2...
If we don't need those parentheses, that would be then array of pointers.
Including those parentheses makes it a pointer to an array.
I want to know for pointer to arrays.
Dynamically...
Hello, I am confused whether 'malloc'ing an array of pointers and pointer to a group of arrays are the same.
Suppose I need an integer pointer to a group of arrays of 2 elements each.
int...
Thanks for the terminology....
Yeah qny, you are quite right...I could have posted in the forum and I usually do, but there was some problem when I was trying to post so at last I put it in pastecode. Anyway now I see that there...
Hello friends, I am just trying to represent a grid by using a collection of node structures. These node structures contain the index locations (x,y) and two characters about the linkage of the node...
:p Hehe....dont worry...There is always a contest every month, you will get to solve more....There is more to come this 1st of September...
hey Click_here, your link was quite useful...It put me into a moment to think...It is the correct approach to find the number of factors. My problem is not linked with projecteuler, actually here is...
Yeah Andreas it was finding the no. of divisors or factors of a number. You put up some interesting fact about the square number....Well I have left that factoring approach. Its not efficient thats...
Hey Adak sorry for replying late, (actually was involved with some exam studies)...oh good to know that you also tried this problem before...as I said it was a part of a programming question and the...
Hello Andreas, what I want to do is count the number of factors f of a number and look if it is odd or even....It is a part of solving a programming question, well but it seems now that calculating...
Thanks Adak....for the suggestion of your calculating one time, I did not notice that....I mean by saying not fitting into my program means that I am trying to solve a question and it gives certain...
Ya right,recursion has to handle the stacks so extra consumption of resources....."An algorithm that efficiently factors an arbitrary integer would render RSA-based public-key cryptography...
Ok I see....using sqrt is not a much good choice then, but still using sqrt will save the time for other some useless looping,actually it will just balance the loading of libraries I guess....Whether...
I agree with what you are saying....The thing is that I want to know if there exist some better algorithm than the straight approach of checking every number if its divisible from n=1 to N for a...
What is the most efficient algorithm for counting the number of factors of an integer?
Is it possible to draw a waveform using C or C++? The type of waveform I have attached it....If its possible I can understand it will be pretty tough so also is there an alternative to it??
Hmmmm...getline() can be used in place of cin.but in case suppose we give an input before getline() and after that press enter,then the getline() fn is skipped.One solution is to use fflush(stdin),...
So it seems that it is better not to use malloc() in C++ for classes.Its more safer with new.I will have to study more about "new" since I am new to C++.
But anyway is there any other option for cin...
Hi anon,It really worked out.And I was very happy happy with the output and it runs fine now.This was really very important to me and it was really a very great help.Thanks for your very kind help to...
Hello everyone,recently I have been trying out a C++ program and it seems that its going beyond my thinkings.So I want your help to solve it out.This program is to create a derived class "master"...
So there seems printing out the name using enum is not going to work.It seems there is no way out for this.
So what I must do is to tell the teacher that its not possible.