Forum: C++ Sep 1st, 2009 |
| Replies: 3 Views: 1,524 That sounds nice. I will take a look at your suggestions and see how that could be done.
This was checking character by character:
String AllChars =... |
Forum: C++ Sep 1st, 2009 |
| Replies: 3 Views: 1,524 I am doing a fuction where I want to check that a String contains only Letters between: "A-Z" and Numbers between: "0-9" and "_"
Instead of checking all one by one. Is there any approach to check... |
Forum: C++ Nov 6th, 2008 |
| Replies: 1 Views: 453 My actual case is that I need to know how it is possible to pass a "string" from Form22 to Form4.
The test I could think of could be:
Lets say that Form22 has a textBox1 that has the string... |
Forum: C++ Nov 5th, 2008 |
| Replies: 1 Views: 453 I am encounter a problem that I dont understand what is happening.
I use the Form application where I from Form4 will open Form22 like this wich works.
#pragma once
#include "stdafx.h"... |
Forum: C++ Oct 8th, 2008 |
| Replies: 4 Views: 433 Thanks, mcriscolo, I think I could have found a solution also by adding Items and choosing "contextMenuStrip1" on the Form properties. I will check your method out also.
/j |
Forum: C++ Oct 8th, 2008 |
| Replies: 4 Views: 433 Narue, I have to answer you well here because this is also not your first time you write this to me.
First I respect what you say, I dont want to be mean either. I begun programming in January this... |
Forum: C++ Oct 8th, 2008 |
| Replies: 4 Views: 433 How is it possible to get a menu where you rightclick on the Form ?
I am not sure if this is the contextmenu. I tried to add this to the Form and also some
components to it but that did however not... |
Forum: C++ Oct 6th, 2008 |
| Replies: 1 Views: 946 Found the solution here.
sr->BaseStream->Seek(Pos, System::IO::SeekOrigin::Begin); |
Forum: C++ Oct 6th, 2008 |
| Replies: 1 Views: 946 When reading a txt file I am using .seekg to set the startpoint in the file to read from.
linepos has a value: 1002106
First I wonder what this value stands for excatly. As I have understand this... |
Forum: C++ Oct 3rd, 2008 |
| Replies: 19 Views: 2,044 Yes, this was the thread I was reading on but I missed it and as I saw it was as simple as this. I was imagining me something different.
It helped alot. Great !
for(int i = 0; i <... |
Forum: C++ Oct 3rd, 2008 |
| Replies: 19 Views: 2,044 In some way it is needed to refer to the previous vectordimension.
The problem is that I dont know how you refer to the previous dimension beginning and end and set this to some sort of an iterator... |
Forum: C++ Oct 2nd, 2008 |
| Replies: 19 Views: 2,044 What I try to find, is the equavilent to the vector ::iterator for the first code.
The first code iterates each Dimension from .begin() to the .end() and then continues
to next dimension for the 3... |
Forum: C++ Oct 2nd, 2008 |
| Replies: 19 Views: 2,044 I found out that "()" was needed. When iterating through the dimensions to show the "TextString" that was put into the List(Dimensions), only 1 MessageBox will appear.
As I have put "TextString" to... |
Forum: C++ Oct 2nd, 2008 |
| Replies: 19 Views: 2,044 When compiling the below code I will have a compileerror that says:
String3D : illegal use of this type as an expression
String2D : illegal use of this type as an expression
String1D : illegal use... |
Forum: C++ Oct 1st, 2008 |
| Replies: 6 Views: 1,541 I think I will go with the loop then, I found out it was very fast also.
I did iterate a ListValue 200000000 times and it only took about 1 second.
/j |
Forum: C++ Oct 1st, 2008 |
| Replies: 6 Views: 1,541 I understand. I have a wondering here. If you would use a for loop to iterate through a series of elements to replace a greater value to find the greatest value.
Will this be as fast as the... |
Forum: C++ Oct 1st, 2008 |
| Replies: 6 Views: 697 yes you are right. I found the text inside. I should have looked there.
Thanks... |
Forum: C++ Oct 1st, 2008 |
| Replies: 6 Views: 1,541 I am using a List where I wonder how it is possible to find the MaxValue searching trough
Value1[0] until Value1[3].
In this case it should return: 12
I have found a ::Max function but this will... |
Forum: C++ Sep 30th, 2008 |
| Replies: 6 Views: 697 Yes it did look backwards:) , I didn´t think it did. I red about LastIndexOf here (http://msdn.microsoft.com/en-us/library/system.string.lastindexof.aspx)
I couldn´t find here where it described.. ... |
Forum: C++ Sep 30th, 2008 |
| Replies: 6 Views: 697 Yes I know that MSDN exists but often the examples and info are not so clear there.
I did look up all members for the String^ before and also found LastIndexOf but as I understand this does not have... |
Forum: C++ Sep 30th, 2008 |
| Replies: 6 Views: 697 I am using this in the std:: to check for the first occurance of " " backwards (rfind).
If I go managed .NET, I wonder if there is any simular method for this
using str->
... |
Forum: C++ Sep 30th, 2008 |
| Replies: 19 Views: 2,044 Mitrmkar,
Thank you! Now it works... |
Forum: C++ Sep 30th, 2008 |
| Replies: 19 Views: 2,044 When using pointers in .NET, you do use * and & to address pointers so the cavet ^ symbol should only meen a type as int and double I beleive like string for the std:: and then String^ for managed.... |
Forum: C++ Sep 29th, 2008 |
| Replies: 19 Views: 2,044 I have tried this approach to declare elements in the 2 Dimensions but with the same Error.
'Object reference not set to an instance of an object'
typedef List<String^>^ Vec1;
typedef... |
Forum: C++ Sep 29th, 2008 |
| Replies: 19 Views: 2,044 I have also tried this approach to declare elements in the 2 Dimensions but with the same Error.
typedef List<String^>^ Vec1;
typedef List<Vec1> Vec2;
Vec2 List1;
for( int j = 0; j <... |
Forum: C++ Sep 29th, 2008 |
| Replies: 19 Views: 2,044 Thanks Sci@Phy but if I run the program with the below code, I will still have the same Errormessage:) It seems that elements is Added but wonder what is being wrong.
'Object reference not set to... |
Forum: C++ Sep 29th, 2008 |
| Replies: 19 Views: 2,044 I have come up with this code where I am creating a 2D list.
Then within a loop I think I am declaring 1000 elements to each dimension wich in the end
will have List[1000][1000].
However when I... |
Forum: C++ Sep 29th, 2008 |
| Replies: 19 Views: 2,044 Thanks, a list it is but this declaration of a 2D vector in the previous post is this really for the System::IO namespace.
I know how to declare a 2D vector in the std:: namespace like this wich... |
Forum: C++ Sep 29th, 2008 |
| Replies: 19 Views: 2,044 I know how to declare a 1D vector like below but how do you declare a 2D vector ?
List<String^>^ Vec1 = gcnew List<String^>(); |
Forum: C++ Sep 29th, 2008 |
| Replies: 6 Views: 1,888 Found a solutions to 'Pos' Positions for the ',' to parse out the values like this. Suppose this could be a solution.
//Create an instance of StreamReader to read from a file.
StreamReader^ sr... |
Forum: C++ Sep 29th, 2008 |
| Replies: 6 Views: 1,888 When reading a file I am trying to split the line and put the comma delimited values into vectors.
It should be something I am doing wrong with the splitting of the line. It seems that ->Split only... |
Forum: C++ Sep 28th, 2008 |
| Replies: 6 Views: 1,888 Ok, I thought something like that too. I will use vectors to store the values I read with the delimiter. I am guessing out some code but are not sure if I am on the right track to do as I do.
What I... |
Forum: C++ Sep 28th, 2008 |
| Replies: 6 Views: 1,888 As I red, Peek() >= 0 will check if the eof file is reached like this.
However I dont really understand how it works when the line, "Line" will be delimited by the "Delimiter".
What comes out of... |
Forum: C++ Sep 28th, 2008 |
| Replies: 6 Views: 1,888 I am using StreamReader to read a File. With the code below I am able to read a whole line.
What I wonder is how it is possible to read a comma delimited file like these lines.
How will I put the... |
Forum: C++ Sep 25th, 2008 |
| Replies: 35 Views: 6,396 You are completely right about that. I have a large amout of code that I use after I red the values from the textfile. I mainly use the std:: namespace to substring, convert from text-number-text,... |
Forum: C++ Sep 25th, 2008 |
| Replies: 9 Views: 746 |
Forum: C++ Sep 25th, 2008 |
| Replies: 9 Views: 746 Yes you are right. When changing that, the test went down from 35 to 20 seconds.
Great to think about these details ! |
Forum: C++ Sep 25th, 2008 |
| Replies: 9 Views: 746 I am looking for fast conversions. I found out that converting with atof is much more faster than using the stringstream like the below tests.
What I look for now is a fast way to convert from... |
Forum: C++ Sep 24th, 2008 |
| Replies: 35 Views: 6,396 :) Thank you a lot !, I will check this code out carefully to see what I can do and understand ! |
Forum: C++ Sep 24th, 2008 |
| Replies: 35 Views: 6,396 >> tokenize the buffer line by line, and then use one line however u want
I must be honest to say that I only know in words how to do this. I have never tokinized something. I have red... |