c++ - convert pointer string to integer
I am trying to convert treePtr->item.getInvest() which contains a string to an integer. Is this possible? ...
I am trying to convert treePtr->item.getInvest() which contains a string to an integer. Is this possible? ...
I'm trying to write some code to remove the first N characters in a string. I could have done this in an imperative manner already, but I would like to see it done in the spirit of functional programming. Being new to F# and functional programming, I'm having some trouble... ...
Forgive me, I'm a beginner. The following code returns a parse error: $query = "INSERT INTO scenario_needgames VALUES ("$id", "Battle of the Bulge")"; the query builder in phpMyAdmin gave me this slightly modified string that works: $query = "INSERT INTO scenario_needgames VALUES (\"$id\" , \"Battle of the Bulge\");"; but I'm confu...
Hi, Thanks to pbos help and its program (published here, for xoring a big file), I performed some tests and I see that I have another problem: having changed the mask by another one of 128-bit, there is no default type as big as needed. I think a solution can be to include a library to increase available integer types... but rather tha...
How can i check if a variable has something in it? I tried checking if a .match() returned null but that wasn't useful for checking with an OR? All ideas would be gratefully appreciated! ...
In .NET, strings are immutable and are reference type variables. This often comes as a surprise to newer .NET developers who may mistake them for value type objects due to their behavior. However, other than the practice of using StringBuilder for long concatenation esp. in loops, is there any reason in practice that one needs to know th...
Given an expression '(lambda (x) x) How can I translate this into a string. I thought symbol->string will do the job but no it cant not a symbol. e.g for a macro to-string: (to-string (lambda(x) x)) this should return >> "(lambda (x) x)" Any ideas folks Thanks ...
I recently was introduced to a large codebase and noticed all string comparisons are done using String.Equals() instead of ==. What's the reason for this, do you think? ...
Hi, In my iphone application i am using MKMapView to display any region(i.e Australia) and it is working fine using coordinates(latitude and longitude).But i want to display the region based on the string (i.e Australia) instead of the coordinates. Lets say i click on the TableView with named string as "Australia" and in the next view i...
I want to replace the last String which is a "," with ")" Suppose the string is Insert into dual (name,date, to be converted to Insert into dual(name,date) ...
Which "shared string" implementation for C++ would you recommend? (Sorry if I missed a similar question. I had a look but could not find any) ...
As per title, what practise for string comparisons do you use and why? ...
I'm looking for a hash function that: Hashes textual strings well (e.g. few collisions) Is written in Java, and widely used Bonus: works on several fields (instead of me concatenating them and applying the hash on the concatenated string) Bonus: Has a 128-bit variant. Bonus: Not CPU intensive. ...
When I write Erlang programs which do text parsing, I frequently run into situations where I would love to do a pattern match using a regular expression. For example, I wish I could do something like this, where ~ is a "made up" regular expression matching operator: my_function(String ~ ["^[A-Za-z]+[A-Za-z0-9]*$"]) -> .... I know...
I know that for an integer, you can use: int value; I tried: string str; but Visual C++ gave me an error. How do I declare it without assigning a value, then using cin >> str later on to assign it? ...
Why doesn't Perl support the normal [] operator to index a string? Almost all major programming languages support this operator,esp the other two 'P': python and php.Moreover,I do think it should be easy to implementate this little syntax.Also,as the philosophy of the perl programming language -- as lazy as we could,so why do we bother t...
I have a query that returns a string, as well as an escape character sequence. (ex. "USA\"") I am using stringByReplacingOccurrencesOfString in this fashion: [theCountry stringByReplacingOccurrencesOfString:@"\"" withString:@""]; But it is still leaving behind a set of quotes. and if I were to try the method again to remove them: [...
hi guys, i'm trying to pass a string from main to another function. this string is a name of text file that needs to be oepened. as far as i can see, i am passing the string alright, but when i try to use ifstream.open(textFileName), it doesn't quite work. but when i manually hardcode it as ifstream.open("foo.txt"), it works just fine. i...
I would like to read a text file and input its contents into an array. Then I would like to show the contents of the array in the command line. My idea is to open the file using: inFile.open("pigData.txt") And then to get the contents of the file using: inFile >> myarray [size] And then show the contents using a for loop. My prob...
Hi, I'm currently having trouble creating an image from a binary string of data in my Python program. I receive the binary data via a socket but when I try the methods I read about on here like this: buff = StringIO.StringIO() #buffer where image is stored #Then I concatenate data by doing a buff.write(data) #the data from the socket...