answersLogoWhite

0

By mistake.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

C plus plus programs - to replace every space in a string with a hyphen?

char *string = "this is a test"; char *p; for (p=string; *p!='\0'; p++) if (*p==' ') *p='-';


What is S A P?

Secondary audio program (most popular being Spanish)


Write a program to count the length of a string without using built in functions?

In JavaScript: To find the length of the string we you length method. __ __ __ Click the button to return the number of characters in the string "Hello World!". click here __ __ function myFunction() { var str = "Hello World!"; var n = str.length; document.getElementById("demo").innerHTML = n; } __ __ __ Hope this helps. Thank you


How do you write C plus plus string concat without builtin functions?

#include<iostream> #include<string> int main() { // the two strings to concatenate std::string str1 = "Hello "; std::string str2 = "world!"; // allocate memory to the concatenated string with null-terminator char* str3 = new char[str1.size() + str2.size() + 1]; // initialise a moving pointer char* p = str3; // copy from the first string memcpy( p, str1.c_str(), str1.size() ); // advance the pointer p += str1.size(); // copy from the second string memcpy( p, str2.c_str(), str2.size() ); // advance the pointer p += str2.size(); // set the null-terminator *p = 0; // print concatenated string std::cout << str3 << std::endl; // tidy up delete [] str3, str3 = NULL; }


What has the author P Rode written?

P. Rode has written: 'Caprice :b[string quartet]'


What is c program to count number of blank spaces in string?

There are many ways to achieve this. Example: #include <iostream> using namespace std; int main() { char str[256]; memset( &str, 0, 256 ); cout << "Enter a string with some spaces: "; cin.getline( str, 256, '\n' ); int count = 0; char * p = str; while( p < str + 255 ) { if( *p == 32 ) ++count; ++p; } cout << """ << str << "" has " << count << " spaces!" << endl; return( 0 ); }


Does the diabolo need special string?

Yes, it does. A great string among the experts is 'Henry' diabolo string. You can get it here http://www.oddballs.co.uk/henrys-string-25m-roll-orange-p-1944.html


What has the author H P Eden written?

H. P. Eden has written: 'A string of sapphires' 'Bread and circuses'


Write a program in c to convert binery number to hexa decimal number?

The question is somewhat ambiguous. If you have a value stored in a c variable, you can output it as a hexadecimal value by using a %x specification (printf("%x",z); prints z as a hex value. There is no specification (in most versions of c to input a binary number). If you mean convert a string which looks like a binary number to a string which looks like a hexadecimal number, then here is a code fragment char b[21]; // b holds binary string - 1 extra byte for null char h[6]; // h holds hex string - 1 extra byte for null char *p; int s; p=b; s=0; while (*p) { s = (s << 1) + (*p-'0'); p++; } sprintf(h,"%x",s);


Javascript code for palindrome?

AnswerFirst find the end of the string.Then compare the first character to the last character, and if they are different the string is not a palindrome.Then go the next pair of characters and do # 2 until you reach the middleHere's a quick and dirty example:int ispalindrome(const char *s){const char *end = s;while (*++end);while (end > s)if (*--end != *s++) return 0;return 1;}This example doesn't skip punctuation or spaces, and it compares letters case sensitively. You are more than welcome to use and improve upon this example.


How to write printf statement for read characters into array str until the letter p is encountered?

In pseudo-code: while ( not(end of string) and letter(string at position X) is not 'P' ){ add(array, newposition) = letter(string at position X); }


Program to concatenate the two strings without using build in functions?

#include<iostream> #include<string> int main() { using std::string; string a = "hand"; string b = "bag"; string c = a + b; // concatenation }