381 Posted Topics
Re: To me, learning English language is far more difficult than learning a programming language. | |
Re: Welcome to DaniWeb. I hope I can assist you along the way to learn C/C++. | |
Re: Welcome to Daniweb and hope to see you in C/C++ forum section. | |
Re: If you know the range of numbers in the array, you can take the advantage of this knowledge to find whether there exists two elements whose sum X in linear time O(n). [B]For example:[/B] [icode]X is 7[/icode] and I have this array called [I]Array A[/I]: 5 1 2 4 3 … | |
Re: The poster was 13 years old when he starter this thread. By now, he would be 18 years old. I don't know if he could hear your messages. | |
Re: [icode]}while ( restart = true );[/icode] will loop infinitely because the condition always is true. Change to [icode]}while ( restart == true );[/icode] | |
Re: Learning programming is about solving problem not about asking for the exact answer. firstPerson gave you a very big hint, now it is time for you to make effort to solve this problem. Good luck. | |
Re: prashant_s, What were you doing? Trying to throw some ugly pieces of code? | |
Re: I have never been a fan of Big Oh estimation and I am pretty poor with it. Correct me if I am wrong. [B]1)[/B] The execution time for the first exercise would be: L(n) + L(n/2) + L(n/4) + L(n/8) + .... + L(n/n) approximately equal to 2n | |
Re: Glad to see someone is so energetic. [LIST] [*]You can start by picking up C++ books [*]Then, some Math book for game programming. [*]Then, choose a graphic library that you prefer and learn it well. [*]Fail to make your dream come true several times [*]Then, keep trying [/LIST] | |
![]() | Re: NathanOliver, don't you think that condition is unnecessary? |
Re: Like what 0x69 has said. You can use array of char to store large number and implement your own addition operation between two numbers. If you want to increase speed performance, you can use array of integer to store large number as well. | |
Re: For further reading: [url=http://gcc.gnu.org/onlinedocs/cpp/Operator-Precedence-Problems.html#Operator-Precedence-Problems]Operator Precedence Problems[/url] [url=http://gcc.gnu.org/onlinedocs/cpp/Macro-Pitfalls.html#Macro-Pitfalls]Macro Pitfalls[/url] | |
Re: The easiest approach that I could think of is to have: [LIST=1] [*][B]4x4 array[/B] to store current falling piece. [*][B]Height x Width array[/B] to store all information of pieces that have fallen. [*]Variables to store position of falling piece inside [B]Height x Width array[/B] [*]Function to check collision between falling … | |
Re: Do you think you have an ability to develop Anti-Virus program yet before asking this question? | |
Re: [QUOTE=ajjg123;1203409]anybody?[/QUOTE] Do you know what is recursive? Do you know how to implement recursive? | |
Re: Please put your code in CODE-tags for the sake of readability for our member. | |
I have recently started to write my own tiny little electronic-book. This e-book is not about teaching C++ from ground up, but it is a collection of C++ pieces that I have learnt during these past few years that I want to share with everyone. I call this e-book "[B][I]C++: … | |
Re: [QUOTE=hurricane123;1198363]then what is the purpise of this website?every time i post any question,it is considered as assignment[/QUOTE] The purpose of this forum = (everything related to C++) [B][COLOR="Red"]minus[/COLOR][/B] (giving free homework's answer) | |
Re: Welcome to daniweb.com. I am the worst when come to database design and SQL. I currently read several database related books. Looking forward to share knowledge with you. | |
![]() | Re: Instead of closing old thread to prevent newbie and spammer to resurrecting dead ancient thread, we can give warning message to anyone who attempt to post in the old thread. [B]For example:[/B] I come across an old thread in daniweb (which I forget to check the thread date). I feel … ![]() |
Re: Welcome to daniweb Chris. Look forward to see your post in C and C++ forum. By the way, One of my brother study at Indiana University too. He is Ph.D candidate there. | |
Re: I think jephthah got it right and it is LCG in my opinion because: [code] tmpseed = (uint64_t)33614U * (uint64_t)seed; // 33614 * X[n] q = tmpseed; // 33614 * X[n] mod 2^32 q = q >> 1; // 16807 * X[n] mod 2^32 p = tmpseed >> 32; // … | |
Re: First of all, [icode]a1 [0][0] = X[/icode] should be [icode]a1[0][0] = 'X';[/icode] because you want to assign character X to an element in your characters array. It also apply to [icode]a1[1][0][/icode], [icode]a1[2][0][/icode], [icode]a1[3][0][/icode], etc... Secondly, you declare two arrays of characters without initiate them. | |
Re: [icode]instructor=='j'[/icode] instead of [icode]instructor==j[/icode] [icode]instructor=='J'[/icode] instead of [icode]instructor==J[/icode] [icode]instructor=='a'[/icode] instead of [icode]instructor==a[/icode] [icode]instructor=='A'[/icode] instead of [icode]instructor==A[/icode] | |
Re: Computer science is too large to define. | |
Re: [code=cpp] "select ORDER_DATE FROM ORDERS WHERE ORDER_NUM =" + num [/code] You cannot simply combine a character string with an integer by simply use operator +. [icode]"select ORDER_DATE FROM ORDERS WHERE ORDER_NUM ="[/icode] returns an address of where character string store and if you add [icode]num[/icode] to that address, it … | |
Re: If computing 2^x to be a constant time operation, it would be an O(1) algorithm. Because it grow too fast that it will always end at the fourth step of the loop. Let's look how big the number grow. [code] Step 1 : 2 ^ 2 = 4 Step 2 … | |
Re: I think [B]Selection Sort[/B] is easier to understand than [B]Bubble Sort[/B] because we, human, use Selection Sort when we try to sort in real life. For example, you have array of 5 integer: [code] [b]6 1 4 8 2[/b] [/code] At first, you will try to find the smallest number … | |
Re: [QUOTE=daviddoria;1184287]Ah, I guess I have to use a deque if I want an iterator.[/QUOTE] You can create your own class. using singly linked list to store data. Then make your class to behave like queue. | |
Re: Since, Narue has pointed how to delete the first occurrence of the selected value. I will show how to delete every occurrence of the selected value. [code=cpp] int i=0, j=0; while(i<length) { if (i > j) { arr[j] = arr[i]; } if (arr[i] == key) { i++; } else { … | |
Re: [B]First of all, how do you store your huge number?[/B] From what I see, you store number in array of integer. [icode]digits[40][/icode]. First digit of the number is stored at the last element of the digit array. However, for example: number 49. Will it store this way: [code] digit[] 0 … | |
Re: Looking at such things (I've seen many more on DaniWeb), I really feel sorry for people (this includes myself) that get such requests.. I just can't understand how easily people rely on someone else to start coding from scratch for them. More frustrating are the lot that say, "Hey, I'm … | |
Recently, I plan to develop a small software that protect user computer from infecting virus from USB flash drive. I come up with various ways to define which file is unsafe and which is safe. The main problem is that I want to prevent user from running unsafe file in … | |
Re: [QUOTE=Ancient Dragon;1119271]I suppose one way to do it would be to create an array of 101 characters, each array element represents the numeric grade. The use the grade to index into that array. For example [/QUOTE] Or create an array of 11 characters [code] char grades[11] = {'J' ,'I', 'H' … | |
Re: [QUOTE=Narue;517028]That's actually pretty bad, ITech. >#include<iostream.h> This isn't standard, and many modern compilers will refuse to accept it. >#include<conio.h> This isn't standard, many compilers may not support it, and there's no need for it in your program. >void main() main returns void. No excuses. >char num[' ']; That's just awful. … | |
Re: Your [icode]isPrime[/icode] function will return 0 for even-number and return 1 for odd-number because your loop always end at the first loop (because you always return a value at the first loop.) Try this one instead: [code] int i; for(i=2; i<(int)sqrt(n); i++) { if(n%i==0) return 0; } return 1; [/code] … | |
Re: [code] int xMin = -10; int xMax = 10; double xData[xMax - xMin]; [/code] xData contains 20 elements starting from 0 to 19. [code] int counter = xMin; for (counter; counter <=xMax; counter++) { [/code] While [icode]counter[/icode] runs from -10 to 10 | |
Re: [QUOTE=Hiroshe;939900]Well, here's the pattern: Start with 1. 1) Put a zero infront of the current number. 2) Invert the number. You can do this with a linked list, or a variable length array. If you want to make it faster, instead of inverting the whole container, just invert what you … | |
| |
Re: It is nice to have ambition. Welcome to daniweb.com. | |
Re: You don't understand the code or the code does not work properly? It seem to work properly for me. | |
![]() | Re: Don't ever bump into Daniweb again. I swear you will never see a light again if you do. Joking :twisted: |
Re: For those who are lazy to search through internet [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1049157810&id=1043284351"]here is the link: gets() vs fgets()[/URL] | |
| |
Re: [QUOTE=baluobs;985530]i want bankers algoritham[/QUOTE] I am greatly disappointed. | |
Re: All your code do is assigning each element of your matrix to -1 and then display them. It is no surprise at all that you did not achieve the assignment because you haven't figured or aren't willing to figured the pattern. Everything in this world is patterned either simple or … |
The End.