can i have a breif explaination about { substr(...,..) } in c++?
350262
substr() returns the portion of string specified by the start and length parameters. \n\nIf start is non-negative, the returned string will start at the start'th position in string, counting from zero. For instance, in the string 'abcdef', the character at position 0 is 'a', the character at position 2 is 'c', and so forth. \n\nExample 1. Basic substr() usage\n\n<?php\necho substr('abcdef', 1);    // bcdef\necho substr('abcdef', 1, 3);  // bcd\necho substr('abcdef', 0, 4);  // abcd\necho substr('abcdef', 0, 8);  // abcdef\necho substr('abcdef', -1, 1); // f\n\n// Accessing single characters in a string\n// can also be achived using "curly braces"\n$string = 'abcdef';\necho $string{0};                // a\necho $string{3};                // d\necho $string{strlen($string)-1}; // f\n\n?>  \n \n\nIf start is negative, the returned string will start at the start'th character from the end of string. \n\nExample 2. Using a negative start\n\n<?php\n$rest = substr("abcdef", -1);    // returns "f"\n$rest = substr("abcdef", -2);    // returns "ef"\n$rest = substr("abcdef", -3, 1); // returns "d"\n?>  \n \n\nIf length is given and is positive, the string returned will contain at most length characters beginning from start (depending on the length of string). If string is less than or equal to start characters long, FALSE will be returned. \n\nIf length is given and is negative, then that many characters will be omitted from the end of string (after the start position has been calculated when a start is negative). If start denotes a position beyond this truncation, an empty string will be returned. \n\nExample 3. Using a negative length\n\n<?php\n$rest = substr("abcdef", 0, -1);  // returns "abcde"\n$rest = substr("abcdef", 2, -1);  // returns "cde"\n$rest = substr("abcdef", 4, -4);  // returns ""\n$rest = substr("abcdef", -3, -1); // returns "de"\n?>
260093
Here it is:-\n\n/* Convert.cpp */\n/* Display the reverse of the input */\n/* By Senthil */\n\n#include <iostream.h>\n#include <conio.h>\n#include <string.h>\n\nvoid main()\n{\nchar inp[10];\nint cnt = 0, ex = 0;\nclrscr();\n\ncout<<"Enter some characters (max limit 10) : ";\ncin>>inp;\n\ncnt = strlen(inp);\ncnt--;\nfor(ex = 0;ex != cnt;ex++,cnt--)\n{\ninp[ex] = inp[cnt];\n}\ncout<<"The reverse of the string is : "<<inp;\ngetch();\n}
312194
I am not sure if this is what you mean.\n\n#include <iostream>\n\nusing namespace std;\n\nvoid main() {\n\n    char ch;\n    cout << "Type in a character, then press enter.&#92;n";\n    cin >> ch;\n    cout << "&#92;nYou typed: ";\n    cout << ch;\n}\n\nThat will read one character from the keyboard for you.\nIt was intentionally made simple.\n\njack573
61693
Assuming C++, the address in memory of p... More specifically, the starting of the character array...
91807
Easy! Now since you didn't specify a language, I'll give you a sample of 3 languages.\n\nHere it is in Java:\n...\nString s = "Some string here";\nString subString = s.substring(2,9);\n...\nIn Delphi:\n...\nvar s, subString:String;\nbegin\n...\ns = "Some string here";\nsubString := MidStr(s,3,10);\n\nIn VB: \ndim s, subString as String\ns = "Some string here"\nsubString = Mid(s,3,10)\n\nIf you need any more help, don't hesitate to e-mail me on nate AT tsamail.co.za.
393251
I'd dump it into a compiler and do it for you but you left too much out.  Impossible to return a syntax error free version without the whole program.\n\nAnyways, I get paid for this.  How many points is this worth?  ...to do someone's homework for him?  Or maybe he's doing contract work!  He's getting $70 and hour to let us do it for him!
978671
[i]  = I\n[d]s = does (without the s it would be do)\n[t]  = to or the\n[o] = of\n\nAnyway I think all the [ ] are suppose to be abbreviations and these are the most likely.◘
195396
What's with the ... ? Is that a space for a number, are you supposed to guess whether to use the + or the x ? I don't get it, I think I'm gonna cry :~(
952303
Bcoz, the char itself returns the address...\nso no need for using '&' before it...
446677
I think you might be asking about the main statement.  This takes the form\n\nvoid main (void)\n{\n}\n\n(ok, sometimes other forms such as int main(int, char*){})\n\nIt is normally used to signify the entry point for an execution unit.\n\nBut, knowing this won't help you much.  There are hundreds of books on the subject, but you should start with K&R.  You won't learn C from Yahoo answers.
345978
/* Here's the entire code [including the main() function]. I have written a generic reverse function which can be used anywhere. */\n\n#include <stdio.h>\n\nvoid reverse ( char str[] )\n{\n        char *ptr = str;\n        int arrLength = strlen( str );\n        int i;\n        char temp[arrLength];\n\n        for ( i = (arrLength-1); i >= 0; i-- )\n        {\n                temp[i] = *ptr++;\n        }\n\n        ptr = str;\n\n        for( i = 0; i < arrLength; i++ )\n        {\n                *ptr++ = temp[i];\n        }\n\n\n}\n\nint main()\n{\n        char str[] = "This will be reversed";\n        reverse( str );\n        printf( "%s", str);\n\n}
253055
Off the top of my head, don't hate me if there are errors...\n\nclass MyVar\n{\npublic:\n  int a;\n  MyVar ( MyVar& src )\n  { a = src.a; }\n}\n\n...\nMyVar p;\np.a = 5;\nMyVar q(p);\n// q.a==5 is true
747743
Can not give you the code or you shall not learn... so please see Page 534 of "Mastering C++" by  R Venugopal, Rajkumar & T Ravishankar  from Tata McGrawHill.\n\nI hope this will help you...
362816
You could try and make a public const in the general declartions area ( I think its still called that ) , something like so\n\nPublic const convert = 2.54\n\nIm not sure if it will require quotes around it or not and you may have to also assign it afterwards ( Not sure on that either, I havent really used vb.net much.\n\nSo it may be \n\nPublic const convert\n\nconvert = 2.54\n\nor it could just be a simple matter of putting quotes around it ie\n\nPublic const convert = "2.54"\n\nLet me know what works :)
244607
reverse( NewString.begin(), NewString.end() );\n\n(You will have to #include <algorithm> )
447347
You may use the charAt method which receives an integer index as a parameter and returns the character in the String that's positioned at that index.\n\nString s = "Hello";\nSystem.out.println(s.charAt(0)); =>This would print the H\n\nThe toCharArray method would convert the String to an array of characters containing the same characters as those in the String.\n\nchar[] C=s.toCharArray(); => C{'H','e','l','l','o'}
673564
It appears to be a string function, one that looks at the character at the position indicateded.  Don't quote me on VB syntax, but something like this \n\nvar string mystring = "Hello";\nmystring.IndexOf('e');  <-- this would give you a value of "1" (one), assuming the indexing starts at zero.