These people are simply boycotting me for their own reasons.
Hold it buddy, everyone makes mistakes, and the same must have happened by looking at your code.
These people are simply boycotting me for their own reasons.
Hold it buddy, everyone makes mistakes, and the same must have happened by looking at your code.
who was nowhere..
break up -> up up and away
In the dark of night, creatures of the hell lurk.
great movie -> date movie
Man and animals should live in harmony. (bleh..couldn't think of anything else)
Bah, a preposterous..
1) Whats the easiest (Free) programing language to create this?
I would have said VB.NET but since its a proprietary language(you have to pay for getting it ) my next best bet is C# if you want to make it windows only or Python if you want to make your application portable.
Both are good languages which don't overload the newbie with all the details and focus on the actual coding..Also C and C++ don't as such support native graphics so for menus and all that you would have to use GTK+ or wxWidgets, both are difficult to use for a beginner.
My opinion: If you haven't started any language as such, jump into Python ( or C# ) and you would be a happy man.
Thank you.
Sentences written in this thread are no more than nonsense.
splint -> splinter cell -- pandora tomorrow :D
the ghostriders think
I have seen a lot of people mention "discworld" here.
What kind of novel or book is it ? Does it fall under the same category as LOTR? What is the concept used in these books ?
Thank you.
The ability to answer this question on your own is part of the process called debugging. It's a skill you're going to need to prosper in this endeavor so you might as well learn how to do it early.
The code won't even compile so how does the question of "debugging" come into the picture ?
@queenma7
The proper way to initialize struct variables is :
typedef struct
{
string name ;
int count ;
} Drink ;
int main( )
{
Drink aDrink = { "cola", 20 } ; // one way
Drink arr_drink[2] = { { "cola", 3}, {"pepsi", 5} } ; // another way
arr_drink[0] = { "cola", 3 } ; // error, won't work
// third way of doing it
for( int i = 0 ; i < 2; ++i )
{
arr_drink[i].name = "" ;
arr_drink[i].count = 0 ;
}
return 0 ;
}
Hope it helped, bye.
of the castle.
What I mean is :
// if the element of array matches with another element in the same
// array, then increment the counter.
if( my_array[i] == my_array[j] )
{
++counter ; // counter = counter + 1
}
// my_array = {1, 2, 1, 3, 4, 5 }
// my_array[i] = my_array[0] = 1
// counter = 2 ( since 1 has a match at 0th and 2nd position )
Hope it helped, bye.
fiendish creatures of
joule effect -> cause and effect
Perfection is what professionals aim for.
Hmm..if thats the case then all you are required to do is to use nested loops. Here is a short algorithm:
Hope it helped, bye.
First of all use int main( void ) and not just main( ) since its not standard.
Don't hard code values in your program, if you want to process 20 values make a preprocessor defination at the start of your program which can easily be modified if you are asked to change the requirements. Using magic numbers as such causes a lot of confusion.
Can you give us a sample run or a dummy example of what kind of output you are expecting ? Are you required to store the occurances or just display them?
Jobe, my very first reaction would be, why not write a generic function instead of restricting yourself with search strings of length 2 or 3.
goes out of bound. Isn't that bad coding?
Its not bad coding, its wrong coding. How can you expect your program to perform properly and in the right manner if you are basing your programming logic on computations on areas of memory which don't belong to you ?
Also the trick which you use will soon turn out to be cumbersome if you are asked to do the same with 3 letters, 4 letters, n letters etc.
My thoughts: always look for generic patterns in the problem statement and if they don't incur additional overheads for that case, go ahead and implement them.
For eg here is one implementation which is possible. I haven't tried it but it should pretty much work.
// retuns the last position in the string where the match was found
// modifies the count parameter passed by reference which displays the
// number of times substring occurs.
int my_strstr( const char* str1, const char* str2, int* count )
{
int i = 0 ;
int len1 = strlen( str1 ) ;
int len2 = strlen( str2 ) ;
int pos = 0 ;
*count = 0 ; // initialize the counter
for( i = 0; i < len1; ++i )
{
if( strncmp( ( str1 + i ), str2, len2 ) == 0 )
{
(*count)++ …
Naa...being a programmer doesn't give me much time to do all that, but still I dream of learning guitaring someday.
Looks like you in one...:D
.So in the
joules -> joules law
Well I don't know which bands have you explored till now so I will just name some random names which I personally like :
And many more... If you have not tried any one of these you can head over to www.youtube.com and search for them and see if you like it or not.
Bye.
You can try out Ragnarok online. Its for free.
You can download the setup files by googling for them.
The only thing is that for playing on the actual server you would need to pay but there are many fan sites out there which host Ragnarok for free.
If you need a list of free fan sites, just ask again.
can do what
thermodynamics -> Calories
Bleh..323.5 after 10 tries.
[IMG]http://img154.imageshack.us/img154/9607/untitlednb7.jpg[/IMG]
Yay...:D
Bleh... what you are saying Mr. Iamthwee makes no sense at all.
This is a suggestion for providing a new shortcut (like CTRL + B) specific to Daniweb and not a query on his part....After all this is community feedback :D
Hey there Steve, welcome to Daniweb.
Looks like even you are a metal fan like me :D
Well we have got Mr. Tgreer who is a professional poet, isn't he ?
something to look
system -> system of a down
Correct English speaking is a matter of practice
How is such..
Hospital is the last place I would wanna go
Hopefully it's just puppy love :p
Whoa...I sometimes really wonder where you come up with all these links from...I mean a link which relates to each post is too good....:D
Okay here is a simple solution which I have got verified so it should work out to be fine for any length strings...
#include <stdio.h>
void remove_s( char str[] )
{
while( *str != '\0' ) {
if( *str == 's' || *str == 'S' ) {
remove_s( ++str ) ;
// after returning from the function don't continue with loop
// this is to avoid the destruction of counter position
break ;
}
else {
++str ;
if( *str == '\0' )
return ;
}
}
--str ; // take into account the increment which had occured
// now its a simple thing of shifting chunks
while( *str != '\0' ) {
*str = *( str + 1 ) ;
++str ;
}
}
int main( )
{
char str[] = "She will be a massless princessi" ;
printf( "\nThe old string: %s", str ) ;
remove_s( str ) ;
printf( "\n\nThe new string: %s", str ) ;
getchar( ) ;
return (0);
}
Hope it helped, bye.
a single swipe
toys -> toy story
tantrum -> kids
Methinks that we just end up wasting our time doing nothing when we could have made the Doom IV :D
Computer is my life and soul
I have decided that I need a break from this site and have chosen to move on with my life.
*ahem* Something tells me that one does not move on with life just because of the posting problem...;)
But still, I would like to hear from her what caused her to make this decision.
Therefore, I would recommend you use something like this:
if(strcmp(arr, arr[j]) < 0)
rather than this:
if(strcmp(arr, arr[j]) == -1)
Yes I would ask you to compulsorily make the change.
Normally the strcmp( ) returns -1 , 0 or 1.
Try out this program:
#include <stdio.h>
#include <string.h>
int main( )
{
// all return -1 on my compiler
printf( "The ans is %d", strcmp( "ABCD", "abcd" ) ) ;
printf( "The ans is %d", strcmp( "abcc", "abcd" ) ) ;
printf( "The ans is %d", strcmp( "abcb", "abcd" ) ) ;
getchar( ) ;
return 0;
}
But the documentation states that it returns a value lesser than 0 when the first string is less than the second string so you are better off using the < operator rather than comparing for -1.
LOTR for me...
death blow which..
healthy -> diet