406 Posted Topics

Member Avatar for timb89

Well try it... Its quite simple.Your first check is good.If they are not of same length then they can't be anagrams. [B]ALGORITHM 1:[/B] Fine now if they are then just initiate two loops and match every letter of the first string with every letter of second string and when you …

Member Avatar for kvprajapati
0
172
Member Avatar for MrNoob

Well one of the ways for the first questions as I thought is this. 1> Take an input number n from the user. 2> "x" is an empty variable. 3> You have "y" as a number under concern. What you need to do is pick the rightmost n bits of …

Member Avatar for Tom Gunn
0
378
Member Avatar for lotrsimp12345
Member Avatar for Niner710

Well as I see it only thing I would comment on is this : [code=c++]infile.open("test.bdb", ios::in | ios::binary);[/code]is not necessary because you have declared infile as ifstream pointer. So this would be sufficient : [code=c++]infile.open("test.bdb",ios::binary);[/code] And ya apart from this I don't see any problem in the code frankly.But I …

Member Avatar for Dave Sinkula
0
2K
Member Avatar for sijithjp

Thank you so much for giving us an [B][COLOR="Red"]INSANE[/COLOR][/B] assignment...but [B]We Are Not In A Mood To Do It ...!!![/B]:angry:

Member Avatar for WaltP
0
86
Member Avatar for athlon32

Such a thing would never happen in [I]DANI[/I] because here on [I]DANIWEB[/I] [B]if there are 100s to tell you where you are right there are 1000s to tell you where you are wrong[/B]...!!! [B]Daniweb ROCKS[/B] !!!

Member Avatar for WaltP
0
230
Member Avatar for rosiecomsoft

Well here is what you need to do : 1>Make use of an efficient hash function which will return the appropriate position of the node to be inserted in linked list.(This needs some research and work). 2>Make every key pass through the hash function and then you get the appropriate …

Member Avatar for csurfer
0
83
Member Avatar for saalvi

[B][COLOR="Red"]Mistakes :[/COLOR][/B] [B]1>[/B] We are not here to do your work here. If you are in such a hurry to submit it on 18th go do it yourself !!! Next time you say you need it this is our reply [B]GO DO IT YOURSELF !!![/B], (Since you have put in …

Member Avatar for siddhant3s
0
173
Member Avatar for elisgugu

[code=c++]buffer=malloc(N);[/code] Check the malloc format.How it is to be used. [B][B]Read the community rules...Post the topic of your query,not something as help or urgent!!![/B][/B]

Member Avatar for elisgugu
0
148
Member Avatar for Zay

[QUOTE=Zay;892623][ICODE]#include <iostream.h> main() { int n, k = 5; n = (100 % k ? k + 1 : k - 1); cout << "n = " << n << " k = " << k << endl; return 0; } [/ICODE] How the value of n become "4" ? …

Member Avatar for kvprajapati
0
1K
Member Avatar for tkansara

Several things are wrong with your code starting with this: [code=c] ptr = malloc(numRows*numCols); [/code] [B]Errors :[/B] What are you exactly trying to do here. This initialization is wrong not only for memory allocation of a 2dimensional array but also for 1dimensional array.What you have done is nothing but [code=c] …

Member Avatar for csurfer
1
93
Member Avatar for beaute

[B]Too many loop holes as I see it :[/B] [B]1>[/B]You need to work on your hash function and also your hashing concept. If you are calculating the hash value of the given word and calculating the hash value of all the words in a file and then matching it,don't you …

Member Avatar for csurfer
0
144
Member Avatar for MrNoob

The code is not only weird its senseless. Firstly two pointers buffer and i manipulating the same char array so what it writes in the array in which condition is completely unpredictable it just depends on both the inputs. And even by going by the function name [B]"squeeze2"[/B] if the …

Member Avatar for csurfer
0
99
Member Avatar for vmanes

Well one advantage of that remote as I see is that channels wont be changed much often... Who would want to touch a slimy remote again and again...;) and ya nice list of ten things we could do without William Hemsworth.

Member Avatar for vegaseat
0
112
Member Avatar for KuriYokan

Well I really don't get it. [B]Here are few mistakes in your question itself :[/B] [B]1>[/B]The class definition should end with a semicolon.You haven't done it. [B]2>[/B]Where are you trying to return the array to ? I mean if you want the array within the function setName then why all …

Member Avatar for Sky Diploma
0
156
Member Avatar for Birendra Dhami

[B][COLOR="Red"]Guys relax.....lets help this person out .You just need to do this !!![/COLOR][/B] [URL="http://www.mathsisfun.com/fractions_addition.html"]Here is a link for third grade "Addition of Fractions" lessons.Go through this first.[/URL] [URL="http://www.research.att.com/~bs/C++.html"]And now for some C++ lessons by the designer and original implementor of C++ Bjarne Stroustrup himself.[/URL] [B]You are really lucky !!! [/B] …

Member Avatar for csurfer
0
110
Member Avatar for revenge2

Nice post there tux4life. Just adding one more little information which is I know is very simple but just in order to complete the thread...:) Every string manipulating function like strcpy strcmp etc take in the starting address of the string as input,so here as we are using character array …

Member Avatar for csurfer
0
109
Member Avatar for themaster

Well you get built in options for the things you have asked both in Dev-Cpp and also Code Blocks...Try them.

Member Avatar for Ancient Dragon
0
293
Member Avatar for vikasnahar

@NeoKyrgyz : Did your post add even an inch to what Salem had said ? Was that really necessary ? (Salem's post was the reason many others didn't post because it rectifies everything with respect to this thread.:) and nothing more could be added.)

Member Avatar for seemant_sun
-1
107
Member Avatar for animefun2

Well if you can control the output of a random function then it wont remain a [B]RANDOM[/B] function right ??? :D Well you can always do this.First assume a variable "a" which is defined as follows : [quote] 1>a=Some random number from 1 to 19 (%20) generated by some random …

Member Avatar for seemant_sun
0
196
Member Avatar for seemant_sun

Every file ends with an [B]EOF[/B] character.Find out what the functions which [B]ArkM[/B] has stated does and use the above information and you are done.

Member Avatar for Ancient Dragon
0
120
Member Avatar for seemant_sun
Member Avatar for Ancient Dragon
0
137
Member Avatar for mrcniceguy

@mrcniceguy : You are pretty old to this community 148 posts still asking for codes ??? [B][COLOR="Red"]SHOCKING !!![/COLOR][/B]

Member Avatar for mrcniceguy
0
113
Member Avatar for abhishekmadaan

Well fptr.open(<filename>,ios::out|ios::app) helps you to append the data to the end of the file. But I don't think you can append it from the beginning of the file because the concept of append defines itself as adding contents to the end. You can always do this : 1>Create another temporary …

Member Avatar for ArkM
0
98
Member Avatar for ahspats

Here is an algorithm for it : [code=c++] //open a file using fstream objects say file and functions like file.open() in input mode // Create a string variable which can act as a buffer for holding the values while(getline( <file descriptor value>, <buffer object>)!=NULL) { int key; string skey,value; //extract …

Member Avatar for csurfer
0
163
Member Avatar for aravasai

[B]Mistake 1[/B] : [B][COLOR="Red"]Put your codes inside code tags or else no one will care to look at it.[/COLOR][/B] [B]Mistake 2[/B] : exit() is a function and it is defined inside cstdlib header with respect to c++ and you haven't included it in the headers so the error not defined …

Member Avatar for Stinomus
-1
18K
Member Avatar for gretty

@StuXYZ : [QUOTE=StuXYZ;887842]Several things from your question: First the string part. You have many options (a) you can indeed use insert but the method requires an iterator to define the position for insertion. (b) the easiest to use simply += e.g [code=c++] char p='x'; std::string A("test"); A+=x; // A is …

Member Avatar for jephthah
0
702
Member Avatar for jazu100

> <conoi.h> > getch() to look at the program output Already Extinct.Try using newer standard coding styles. >Hi, >to answer this question you need to have some experience >about php... Even though relevant sounds a bit rude.It sounds like "Read my thread if you are educated enough".

Member Avatar for ShawnCplus
0
846
Member Avatar for GrimJack

We don't really need to define [B]power[/B].And we humans fear only the things which aren't understood,so may be the undefined power defines itself in this way itself to maintain a balance in nature.We don't even need to give it a name. So if given a thought [B]"This undefined power itself …

Member Avatar for GrimJack
0
716
Member Avatar for chiroc

Errors I found : [code=c] int cla_start_count=0,i; cla_start=*cla_head; while (1) { if (cla_start_count != 0) { cla_start=*cla_head; for (i=cla_start_count;i>0;i--) { cla_start=cla_start->next; } } if (cla_start->next = NULL) // Error { break; } [/code] Error : Assignment operator instead of comparison operator.You need to use [COLOR="Green"]==[/COLOR] and you have used [COLOR="Red"]=[/COLOR]. …

Member Avatar for csurfer
0
664
Member Avatar for vivek3227

@Sky Diploma : You didn't get him I suppose... He is directly asking for the codes. He is [B]One of those highly honest [COLOR="Red"]lazy[/COLOR] code hungry fellows...[/B] ;););) Give him ten more links for great algorithms he will ask you a new one which will give him the codes directly.

Member Avatar for siddhant3s
0
124
Member Avatar for rabbitwat2

[B]"After reading all the above posts once"[/B] you will know your question itself has your answer. 1>Convert float to string. 2>Concatenate using srtcat or strncat as said by you or snprintf as said by Arkm. When you know everything did you try to [B]google[/B] out first?I think you lost your …

Member Avatar for rabbitwat2
0
157
Member Avatar for yun

Try Google Scholar and Scribd.You will get whole lots of stuff...!!! In Scribd you can even download pdf format itself... :D

Member Avatar for Stinomus
0
438
Member Avatar for NathanOliver

Well what are you aiming your text encryptor to work for? It just depends on the application for which you are designing it for. More over the efficiency of working of your encryptor also matters.If its fast but not a good encoder then its a waste. And what type of …

Member Avatar for NathanOliver
0
152
Member Avatar for horiya

You have a problem with the whole program or just a part of it ? Because its really hard to scan through every part...

Member Avatar for tux4life
0
133
Member Avatar for ithelp

Spacebar is most used in my computer.Poor thing gets all my trashing (only key with two finger access).Both my thumbs just pounce on it.;) Unused key : Default windows key !!! :)

Member Avatar for vegaseat
0
164
Member Avatar for cooldev

I got how you are trying to generate the prime numbers but you have messed it up to a great extent. >Assume another variable lim which has the maximum index of prime numbers stored in array p.That is if you have got 3 prime numbers p[1],p[2],p[3] then lim is 3 …

Member Avatar for cooldev
0
97
Member Avatar for kabeer62

The most [B][COLOR="Red"]Honest[/COLOR] Post[/B] I have ever seen !!! This person has directly shown us the places where we need to code for him. Wow !!! He is honestly saying [B]"Look guys i have commented in places where you need to put in your codes,and better do it fast".[/B]:D This …

Member Avatar for KuriYokan
0
120
Member Avatar for andonyan

You haven't even tried to overload + and - operator. [B]First read about it,try it and come back to us with errors or bugs,then we will help you[/B]. And next time put your code inside code tags. P.S : [B][U][COLOR="Red"]We are not a bunch of jobless people[/COLOR][/U][/B].

Member Avatar for Sky Diploma
0
323
Member Avatar for KuriYokan

Think [URL="http://en.allexperts.com/q/C-1040/RTTI.htm"]this[/URL] can help you a bit.

Member Avatar for KuriYokan
0
139
Member Avatar for ogwiz

@Ancient Dragon [code=c]*p2 = 0;[/code] Hey shouldn't the above code be [code=c]*p2 = '\0';[/code] more precisely to signify null character even though both lead to ascii zero itself. And you normally avoid typecasting of malloc right ? Any special purpose here ?

Member Avatar for ArkM
2
106
Member Avatar for Pavan_

I suppose you are using some compiler like TC because if you try to do something like array[-1] in gcc then it gives a segmentation fault. Actually the concept is like this.When you write a statement like [code=c]int array[10];[/code] 10 consecutive integer blocks are alloted in memory with name array …

Member Avatar for ArkM
0
148
Member Avatar for mbartos

Try to clear the contents of the stream at strategic points. Read more on [B]"flushing the standard input stream in c"[/B]. :) You can code the getans() function in a far better way. And asking you out of curiosity "Being a newbie how did you know it was taking 10 …

Member Avatar for ArkM
0
322
Member Avatar for Mudi

You wont get codes here,but we will help you code. Do this: 1)Take the two strings into a char array(Store those two strings). 2)Traverse through those strings and get the numeric values in that string separated by a "." character and store these values as another string. 3)Find a way …

Member Avatar for siddhant3s
0
117
Member Avatar for happypig112

Take input in an char array and swap the positions.Hold two pointers say i and j i pointing to 0 and j to last input character position.Swap arr[i] and arr[j] and then i++,j--;then again swap until i=j.

Member Avatar for tux4life
0
76
Member Avatar for AnujSuper9

Attachment point theory is good.You can create a board in which you assign three different symbols which mean <a char is placed here>,<a char can be placed here>,<a char is not placed but you cannot place a character here.> And for the question you have asked what you can do …

Member Avatar for jephthah
0
6K
Member Avatar for mimio134

conio.h is an [B]EXTINCT[/B] header file.And we don't even want to save it. Daniweb has several discussions regarding not to use: [code=cplusplus] getch(); system("pause"); [/code] for looking at the output. But instead to use: [code=cplusplus] cin.get(); [/code] You are doing nothing but printing a string here: [code=cplusplus] for(p = listA.begin(); …

Member Avatar for Sky Diploma
0
2K
Member Avatar for pspwxp fan

Its better if you post the code which you have tried so that we can believe you have actually worked on it.But you have asked just for the algorithm here you have. 1)Run outer loop (say for loop) n number of times where in n=number of lines. 2)Assume a variable …

Member Avatar for pspwxp fan
0
577
Member Avatar for atman

Your code doesn't involve any c++ concepts. It is completely a c code I should say.And I think you are getting confused the order of execution is : [code=c] printf("Enter Your Age: "); // Executes 1st age = getInt(IsValidAge); // Executes 2nd printf("Enter your driving test mark: "); //Executes 3rd …

Member Avatar for Salem
0
158
Member Avatar for don0369

Well you don't even need to know the number of lines in the file. Use this : [code=cplusplus] fstream f_ptr; string str; f_ptr.open(<filename>,ios::in); while(!f_ptr.eof()) getline(f_ptr,str,<delimiter>); [/code] This complies to your requirements when the fields are delimited by some value.

Member Avatar for don0369
0
120

The End.