381 Posted Topics

Member Avatar for monstercameron

To me, learning English language is far more difficult than learning a programming language.

Member Avatar for 0x69
0
263
Member Avatar for sirio.bm

Welcome to DaniWeb. I hope I can assist you along the way to learn C/C++.

Member Avatar for maceman
0
118
Member Avatar for BigRikk
Member Avatar for vivek01anand

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 …

Member Avatar for invisal
0
114
Member Avatar for JTroopSoldier

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.

Member Avatar for smokewire
0
220
Member Avatar for mebob

[icode]}while ( restart = true );[/icode] will loop infinitely because the condition always is true. Change to [icode]}while ( restart == true );[/icode]

Member Avatar for thelamb
0
103
Member Avatar for AspiringCoder

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.

Member Avatar for AspiringCoder
0
186
Member Avatar for stanleyz
Member Avatar for seven11

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

Member Avatar for AuburnMathTutor
0
110
Member Avatar for Theo Gooden

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]

Member Avatar for Nahiyan
0
168
Member Avatar for Griff0527
Member Avatar for tskellyfla

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.

Member Avatar for tesuji
0
106
Member Avatar for urbangeek

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]

Member Avatar for urbangeek
0
163
Member Avatar for btbam006

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 …

Member Avatar for packetpirate
0
138
Member Avatar for Mike bruce geek
Member Avatar for 0x69
0
59
Member Avatar for insanely_sane
Member Avatar for quicktpgo
Member Avatar for ajjg123

[QUOTE=ajjg123;1203409]anybody?[/QUOTE] Do you know what is recursive? Do you know how to implement recursive?

Member Avatar for ajjg123
0
450
Member Avatar for pichi89
Member Avatar for pichi89
0
130
Member Avatar for invisal

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++: …

Member Avatar for invisal
3
211
Member Avatar for hurricane123

[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)

Member Avatar for VernonDozier
-3
219
Member Avatar for bookworm2010

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.

Member Avatar for maceman
1
122
Member Avatar for diafol

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 …

Member Avatar for diafol
1
716
Member Avatar for CSherman

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.

Member Avatar for mackone
0
79
Member Avatar for oggiemc

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; // …

Member Avatar for invisal
2
1K
Member Avatar for omgaga

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.

Member Avatar for invisal
0
494
Member Avatar for omgaga

[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]

Member Avatar for omgaga
0
115
Member Avatar for andii_sfx
Member Avatar for AndrewT55

[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 …

Member Avatar for AndrewT55
0
4K
Member Avatar for ashkash

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 …

Member Avatar for invisal
0
95
Member Avatar for Trents

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 …

Member Avatar for invisal
0
147
Member Avatar for daviddoria

[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.

Member Avatar for mattjbond
0
168
Member Avatar for xofth

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 { …

Member Avatar for Narue
0
141
Member Avatar for jprogram

[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 …

Member Avatar for WaltP
0
119
Member Avatar for Dani

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 …

Member Avatar for BestJewSinceJC
5
4K
Member Avatar for invisal

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 …

Member Avatar for strmstn
0
133
Member Avatar for jennystc

[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' …

Member Avatar for abhimanipal
0
190
Member Avatar for number87

[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. …

Member Avatar for taepodong1101
0
203
Member Avatar for thebluestar

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] …

Member Avatar for thebluestar
-1
149
Member Avatar for dylank

[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

Member Avatar for invisal
0
1K
Member Avatar for nandini vishuu

[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 …

Member Avatar for karthik viswam
0
190
Member Avatar for sbhavan
Member Avatar for Vineeth K
Member Avatar for jralexander137

You don't understand the code or the code does not work properly? It seem to work properly for me.

Member Avatar for jralexander137
0
913
Member Avatar for colin_smith

Don't ever bump into Daniweb again. I swear you will never see a light again if you do. Joking :twisted:

Member Avatar for crimgirl
0
50
Member Avatar for D_switch

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]

Member Avatar for D_switch
0
5K
Member Avatar for Kombat
Member Avatar for ameneh_p

[QUOTE=baluobs;985530]i want bankers algoritham[/QUOTE] I am greatly disappointed.

Member Avatar for mrnutty
0
157
Member Avatar for johnab2112
Member Avatar for D_switch

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 …

Member Avatar for D_switch
0
164

The End.