Monday, May 24, 2010

Which strings are best for the G and C Strings on a Cello?

My teacher recommends me to switch the lower strings on my cello because it doesn't match the sound well. I currently have Helicore. Which is the best or a good one to choose from?

Which strings are best for the G and C Strings on a Cello?
Personally I think Helicore strings are the best, but if your teacher wants youto get new strings you should try gettind Dominant strings





hope this helps


Can you help me a problem in arrays of strings in C?

How can I copy a string (array of character) to an array of string such as:





char text[a][b];





wherein a is the index number of the array and b is the max length of array of characters that can be stored in the array..





For example I have an array of characters "char word[20];"


How can I store it to an array of strings "char text[99][20];"??





Please help.. And thanks..

Can you help me a problem in arrays of strings in C?
you can use the strcpy() function.





strcpy(text[99], word);





or:


for (int a = 0; a %26lt; 20; a++)


{


text[99][a] = word[a];


}





both will work.
Reply:Yes it is possible!!


Wat U need to do is that for example


let








char word[5]={'a','b','c','d','e'};


char test[20][10];


for(i=0;i%26lt;5;i++)


{ {test[p][q]=word[i];


q++;}


if(q==10)p++;


}








Ok Gud LC Bye
Reply:for (int x=0; x%26lt;20; x++)


{


text[0][x] = word[x];


}





// This will copy the char array word into the first row in text.


// word is a one dimensional array.


// text is a two dimensional one.


Anybody genius in c++ programming .This question is specially to them........?

Describe about c-strings in c++ programming .mention its functions


and also advantages of using these strings while programming....

Anybody genius in c++ programming .This question is specially to them........?
Hope this will help u


http://www.cprogramming.com/tutorial/les...
Reply:What are c-strings?
Reply:You don't need to be a genius to answer that.





Don't be so specific like that - give _everyone_ an opportunity to help you. Otherwise it's called "looking a gift horse in the mouth".





Rawlyn.
Reply:yes indeed

baseball cards

How to check for anagrams in C++?

I need a program to check two entered strings of text and see if the strings entered are anagrams, disregarding the case of the letters, and ignoring spaces (i.e. "Mother in Law" and "Woman Hitler" are anagrams). The strings won't be any longer than 500 characters.





I can't figure out what to do with this because it has to use arrays, which I have never been good with, and the emphasis is supposed to be on use of c strings.





I do know that it essentially needs to do this: change the case of the two strings and remove anything that isn't a letter, then sort the letters, and finally determine if they are the same (are they anagrams?).





I'm trying to keep this "simple." Can anyone help me with a program that does this? Thanks SO MUCH in advance!

How to check for anagrams in C++?
Well, in programming, we always try to get a clear problem definition and logical solution before we start coding.





Oh wait...I was thinking of a palindrome...





Answering questions for people is like programming. We should think 1st. :-)





Yes, sorting is a good idea. And so is changing case....changing case before the sort will enable a clean sort...





1 - Change both strings to lowercase with _strlwr( char *string );





2 - sort both strings... see qsort() for a cheap easy solution that your compiler probably already has. All mine have had qsort().





3 - kill whitespace. You mite need to build a function for this...but qsort should have moved all the whitespace to the end (or begining) which makes it easier (especially if at end).


- You can kill trailing whitespace very easily by putting a null '\0' at the very first instance of white space, if whitespace is at the end, like so:


for(ii=0; ii%26lt; strlen(string); ii++)


if(string[ii] == ' ') // a space?


{


string[ii] = '\0'; ///kill it and cap the string


break; // we're done


}








4 - compare the two strings with strcmp(). If they match, they're anagrams





That's our flow plan and function ID.
Reply:so its a "string compare" your doing ? ;-)





on the first one, u could have a pointer.. basically u check a letter against the second string...





you either have true / false... you need a recurssive loop that checks till end of line / null





it will either return TRUE and exit that loop.. then get ++ the string1 .. and repeat scanning string2..





if it returns false, after the end of string2... obviously they aren't the same..





i would have an array or struct, with a flag in for each character.. 1 exists.. 0 doesn't exsist





then print results.. eg..





found =


not same letters =





and no i'm not gonna do the code, u've had enough clues to do ya own homework =)
Reply:It is not that easy. May be you can contact a C++ expert at websites like http://askexpert.info/


How do i know if my bass is tuned to C correctly?

i just tuned my low e string to C so it would sound better when playing SOAD seeing as how most of there songs are on only one or two strings.


its tuned to C but its really loose and buzzes off the frets so im not sure if its right

How do i know if my bass is tuned to C correctly?
If you're going to tune down that far, you'll need thicker strings, and possibly a neck tweak.


Java equivalent to System.Text.StringBuilder in C#?

I want to build a very large string from lots and lots of small strings. In C# I would use System.Text.StringBuilder without hesitation. At present I am using java.io.StringWriter, but I am concerned that it may not be efficient enough? Is there a better option? MUST be FAST! Thanks in advance.

Java equivalent to System.Text.StringBuilder in C#?
That is not what StringWriter is for. StringWriter is a character-based output stream that writes the bytes to memory.





Use java.lang.StringBuilder. It was added in Java 5 (JDK 1.5). It is similar to java.lang.StringBuffer, but without the synchronization. So, if you plan on designing your program such that only one thread will be using it, use the StringBuilder.


C - How do I save data in a text file?

I have made a maze game in C and am stuck on how to get a user name and save the username and score on a text file. I don't know much about string in C except that "it is an array of characters". I know a user name will need to be string so I am using this:





char username[3];


scanf("%s", username);





I am assuming the variable 'username' will be saved to a file but I do not know how to do this. Any ideas?

C - How do I save data in a text file?
You need the following basic steps:





FILE *fp; //create a file pointer


fp = fopen("file","w"); //open "file" for writing "w"





//check if the file was opened without errors


if(fp==NULL) {


printf("\nCould not open file.. aborting!!");


exit(1);


}





//write to file - you have a number of options here - read more about the functions to suit the formatting and data you need to write to file - one example below:





fprintf(fp, "%s %d", username, score)





fclose(fp); //close the file pointer once you are done writing to the file.
Reply:Use fprintf() function or fwrite() function. Refer the page given below...

artificial flowers