161 Posted Topics

Member Avatar for buddha527

Or maybe [CODE] arr1 = 3 0 0 5 size=4 arr2= 3 0 5 size=3 // array sol of size 5 here [/CODE] then we need the array solution as size 4+1. It will still be simulation of decimal addition, but in that case two loops might be required. One …

Member Avatar for vmanes
0
2K
Member Avatar for ar31an

[Quote] A year is a leap year, if it is divisible by 4. [/Quote] That is incorrect. Check this thread for determination of leap year [url]http://www.daniweb.com/forums/thread118753.html[/url]

Member Avatar for hammerhead
0
107
Member Avatar for knewc

^ I think so. Most people on this forum would not find this problem challenging.

Member Avatar for ithelp
0
162
Member Avatar for mikky05v

[quote]and must be able to handle unusual situations (e.g., what if two days have the same number of cars?)[/quote] For this you can do what Ancient Dragon said and find out the maximum/minimum value and then traverse the array once again and compare each element with the maximim/minimum value, if …

Member Avatar for hammerhead
0
150
Member Avatar for robotwannabe

I would suggest you use stepper motors [url=http://en.wikipedia.org/wiki/Stepper_motors"]Stepper motors[/url] for the controllers try pic [url="http://en.wikipedia.org/wiki/Pic_microcontroller"]pic microcontroller[/url] or AVR series from Atmel [url]http://en.wikipedia.org/wiki/Atmel_AVR[/url]. Coding for both is done in C and can be easily programmed ( I use AtMega 16 from Atmel). The softwares are variable depending on the microcontroller you …

Member Avatar for robotwannabe
0
236
Member Avatar for hammerhead

When I try to view my profile by clicking on the link of my id on the top ( not the control panel). I am getting this error [quote] This user has not registered and therefore does not have a profile to view. [/quote] It was working fine a few …

Member Avatar for hammerhead
0
64
Member Avatar for ikojoruth

OSI model is representation of networking via seven layers namely. Physical layer, Data link layer, network layer, transport layer, session layer, presentation layer and finally application layer. More info [url="http://en.wikipedia.org/wiki/OSI_model"]here[/url] If you are interested in networking then it would be a good start to know about the various layers.

Member Avatar for hammerhead
0
106
Member Avatar for Black Magic

A simple method for calculating square root of a number "a" is given by newton iteration as [CODE=C++] for(int i=0;i<10;i++) { xn=.5*(x0+(a/x0)); x0=xn; } [/CODE] where x0 is initialized to 1. Use float comparisons and loop till xn equals x0 here I have used a loop for simplicity. Again why …

Member Avatar for hammerhead
0
136
Member Avatar for timdog345

In the above loop you would have to check for every i if it is odd or not using [CODE] if(i%2!=0) [/CODE] alternatively you could use i=i-2 instead of i-- and simply display the numbers.

Member Avatar for hammerhead
0
126
Member Avatar for The Dude
Member Avatar for steven woodman
Member Avatar for vegaseat
Member Avatar for Ben10

At line 7 when the loop ends, f will be 10. You are simply multiplying 1*10 and storing it in result. You can make result an array of size 10 then use [CODE=C++] result[f-1]=k*f; [/CODE]

Member Avatar for Ben10
0
88
Member Avatar for Lensva

I dont know what you are trying to do but in line 12 during the last iteration of the loop i=4, i+1 will be 5 that will go out of bounds for the array pass. Run the loop till i<4 because there will be no i+1 for the last element.

Member Avatar for Lensva
0
93
Member Avatar for cnet1989

I have not read your problem in detail but a very interesting solution was provided here for generating unique random numbers [url]http://www.daniweb.com/forums/post345682-9.html[/url]

Member Avatar for cnet1989
0
93
Member Avatar for The Dude
Member Avatar for The Dude

Addiction for anything is bad (at least that is what I think). I myself was addicted to computer games once.

Member Avatar for jwenting
0
139
Member Avatar for samaru

Half Life 2, Max Payne, Doom 3, AOE 2, FIFA 05. Best multiplayer games I have played are Quake 3 CPMA and Counter Strike 1.6 :D

Member Avatar for Chaky
0
1K
Member Avatar for Fahmid
Member Avatar for Fahmid
0
3K
Member Avatar for Ramy Mahrous

[QUOTE=Lardmeister;550298]Think about it! If you nuke Iraq, the fallout will go to downwind countries like India, China, Indonesia, Australia and so on.[/QUOTE] Also there will be internal pressure from people against it. I remember that many Americans opposed the war on Iraq. Nuking them will trigger an outrage.

Member Avatar for DimaYasny
0
289
Member Avatar for Jboy05

sumE, num and temp are local to main. Pass these variables by reference in order for the changes to show.

Member Avatar for VernonDozier
0
174
Member Avatar for majestic0110
Member Avatar for demroth

If you want to do it by using regular expressions you would need a lexical analyzer. For C/C++ lex is usually used. Here is a tutorial page [url]http://dinosaur.compilertools.net/lex/index.html[/url] as for the code [CODE=C++] int i, char x; for(i = 0; i <= test_string.length; i++) //checks the entire length of the …

Member Avatar for Rajith Cherian
0
120
Member Avatar for prayami

Why create an array? A simple if can do the job unless I am missing something [CODE=c++] if (fabs(value-value_to_be_compared)<.001) { // match found } [/CODE]

Member Avatar for prayami
0
177
Member Avatar for Crushyerbones

Factorial of any number greater than 5 ends with a zero. For a larger number, the number of zeroes at the end constitute a large part of the number. If you can eliminate those zeroes it will help. If you can simple check at the end of the factorial that …

Member Avatar for Crushyerbones
0
242
Member Avatar for uncertainty
Member Avatar for hammerhead
0
112
Member Avatar for nurulshidanoni

[QUOTE=nurulshidanoni;558412]Is it true to make a condition statement?[B] &&[/B] [code=C++] int count; count++; for ( int i = 0 ; i < students.size (); i++ ) { for ( int k = 1;k<students.at(i).examcode.size(); k++ ) { if (students.at (i).examcode.at(0)==1 && students.at (i).examcode.at(k)==1) { count++; } } } cout<<"(1,1)="<<count; cout <<"\n"; …

Member Avatar for hammerhead
0
150
Member Avatar for techno t

Power grid failed twice in the past 3 days resulting in power failure for 12hrs and 10 hrs respectively. And its 32 degrees celsius here in Delhi :(

Member Avatar for jbennet
0
102
Member Avatar for dilip.mathews

[QUOTE=dilip.mathews;230318]I dont want the maximum sum . I want the subset with maximum sum. {5,-2,10,-4} Here the subset with maximum sum is {[COLOR=blue]5,-2,10[/COLOR],-4}. The program should output {5,-2,10} I think u got my point.[/QUOTE] I dont understand, sum of the subset [5,10] is clearly greater than that of [5,-2,10]

Member Avatar for omko
0
1K
Member Avatar for technogeek_42

Maintain two counters and iterate the string one character a time. Use one if condition to check if the character is a vowel or a consonant and increment the respective counter.

Member Avatar for technogeek_42
0
65
Member Avatar for heshangho

What I would suggest is that you make a function of everything starting from "int g;" to the end of the while loop. Then in main() call the function inside another loop as [CODE=c] do { function_here(); printf("Excellent!you guess the number\nWould you like to play again (y or n)?\n"); scanf("%c",&a); …

Member Avatar for heshangho
0
142
Member Avatar for sneekula
Member Avatar for reddawg
0
1K
Member Avatar for darklich13

Calculate different values of y by incrementing x by small steps. In the char array set the value char[x][y] to '*' For example y=0 if x=0 i.e char[0][0] = '*' y=1 if x=1 i.e char[1][1]='*' y=4 if x=2 i.e char[2][4]='*' and so on. Though it will go out of bounds …

Member Avatar for darklich13
0
119
Member Avatar for birdy_28

[CODE]array = new messages[size];[/CODE] array is of type int and you are trying to create an array of type messages. Change the datatpye of array to messages. [CODE]array[i].messages = value;[/CODE] I cant say what you are trying to do here, messages is the name of the structure. If you mistyped …

Member Avatar for vijayan121
0
113
Member Avatar for hammerhead

I just started with image processing concepts and cannot decide upon a platform to try examples on. The two most commonly used platforms are Matlab and C# (using Aforge libraries). I know a bit of both and learning the syntax will not be a problem. Which one should I go …

Member Avatar for hammerhead
0
92
Member Avatar for jkdil33

In order to create a executable, you need Matlab Compiler. [url]http://www.mathworks.com/products/compiler/[/url] I think this might help in creating an exe from c++ [url]http://www.onecore.net/howtocreate-standalone-executable-for-matlab-file.htm[/url]

Member Avatar for jkdil33
0
811
Member Avatar for hockeyplayer051

Averaging will not help. Sorting and selecting the middle value will.

Member Avatar for Ancient Dragon
0
97
Member Avatar for atish00

You can set the fonts by using the settextstyle() function. Here is a link with an example [url]http://www.cs.colorado.edu/~main/cs1300/doc/bgi/settextstyle.html[/url] You can set background color using setbkcolor() [url]http://www.cs.colorado.edu/~main/cs1300/doc/bgi/setbkcolor.html[/url] To set the color of the text use setcolor() before settextstyle() [url]http://www.cs.colorado.edu/~main/cs1300/doc/bgi/setcolor.html[/url]

Member Avatar for hammerhead
0
126
Member Avatar for sneekula

I tried drinking beer once, from that day I have always wondered how can people like something that tastes that horrible. I will settle for Pepsi anyday.

Member Avatar for bumsfeld
0
267
Member Avatar for Mido â„¢

The functions are not properly defined. All functions sername(), sertel(), addrec(). Must have an argument of an array type. For example. addrec(char[], double[]) I dont think you have made this program yourself.

Member Avatar for hammerhead
0
225
Member Avatar for larry12720

In strcmp you are passing a pointer of node where you should pass a pointer of char.

Member Avatar for abhikkumarbasu
0
137
Member Avatar for carnage

The things you mentioned are not difficult provided you know object oriented programming in C++. Do classes and inheritance well.

Member Avatar for hammerhead
0
145
Member Avatar for lazybugger

Something on compression maybe. Try compression using Huffman coding. There is plenty of reference material on it on the internet.

Member Avatar for hammerhead
0
138
Member Avatar for sonygamer

Okay I made this code on Turbo C [CODE] #include<iostream.h> int eig(int num) { if(num<10) { return num; } else { return eig(num/10)+(num%10); } } void main() { int n,ans=0; cin>>n; ans=eig(n); while(1) { if(ans<10) { break; } else { ans=eig(ans); } } cout<<"Eigen number is "<<ans<<endl; } [/CODE] Its …

Member Avatar for Lerner
0
336
Member Avatar for suresh1010

[QUOTE=atish00;547934]is the s.erase user defined fuction ?? coz I can't find it anywhere in c++ help.[/QUOTE] Which version of C++ are you using? It is not there in Turbo C++.

Member Avatar for Ancient Dragon
0
180
Member Avatar for noble3ad

Use else if statement. According to your code, if a=0 and b=0 then both the first and the second if statements will be executed. And the output will be "There are no solutions" "There is one solution x" use this [CODE] if (a == 0 && b ==0) { printf("There …

Member Avatar for noble3ad
0
109
Member Avatar for jure.gregorin

Try a technique called circle extraction using Hough transform. It may be difficult to implement but a line extraction version is given in aforge examples.

Member Avatar for BlackSun
0
140
Member Avatar for majestic0110

I am presently working on emulation of human movements through robotics as my college project.

Member Avatar for Lardmeister
0
154
Member Avatar for Dr_Pepper

From what I remember of my coordinate geometry, testing for a point inside a triangle wasnt easy. Try this [url]http://mathworld.wolfram.com/TrianglePointPicking.html[/url] you might have to translate one point to match that of origion.

Member Avatar for hammerhead
-1
525
Member Avatar for AWDracer

The End.