Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
E

error1408

@error1408
About
Posts
57
Topics
18
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Problem with Array of char*
    E error1408

    Ok I think I got it. So is it right, that in my case I can not know if the char *name that I get is a literal or not so to be sure it's not I have to create a temp array?

    C / C++ / MFC help data-structures question

  • Problem with Array of char*
    E error1408

    DavidCrow wrote:

    How about something like: char *temp = new char[strlen(name) + 1]; strcpy(temp, name); Helper::instance()->strtoken(temp, ".", token);

    Ok this works! But I don't understand why...could someone explain it to me? Why does the param char * not work but the char * thats created here? Btw. I have to DELETE the char *temp afterwards, right?

    C / C++ / MFC help data-structures question

  • Problem with Array of char*
    E error1408

    Ok thx. I will try it in the evening today and post my results.

    C / C++ / MFC help data-structures question

  • Problem with Array of char*
    E error1408

    But if I call it with that char* it crashes! I have a function

    doSomething(char *name)
    {
    [...]
    strtoken(name, ".", token); //crashes
    }

    That works but it does not help me:

    doSomething(char *name)
    {
    [...]
    char foo[] = "hello.world";
    strtoken(foo, ".", token); //does NOT crash
    }

    But how can I use strtoken with char *name? Can I make a char foo[] out of char *name?

    C / C++ / MFC help data-structures question

  • Problem with Array of char*
    E error1408

    Your right, I get a char* name as a parameter and use it to call the function. Thats the cause of the crash. But how do I solve this problem? I have this char *name and it has to be tokenized. How can I do that as strtok crashes with it? Btw. thanks for your help, I would have never thought of THAT ^^

    C / C++ / MFC help data-structures question

  • Problem with Array of char*
    E error1408

    Ok look, here is the full function (that I did NOT write myself) which should work correct, but I think >>I<< do something NOT correct. Its a tokenizer for char-strings

    int strtoken(char *str, char *separator, char *token[])
    {
    int i = 0;

    	token\[0\] = strtok(str, separator); //This line crashes
    
    	while ( token\[i\] ) 
    	{
    		i++;
    		token\[i\] = strtok(NULL, separator);
    	}
    	return ( i );
    }
    

    And I call it that way atm:

    		char \*token\[256\]; //I think that is an array of char\*, isn't it?
    		for(int i = 0; i < 256; i++)
    		{
    			token\[i\] = '\\0';
    		}
    		Helper::instance()->strtoken(name, ".", token);
    

    name is a char* e.g. "system.fullscreen"

    C / C++ / MFC help data-structures question

  • Problem with Array of char*
    E error1408

    Hi, I have a function in a class that has the following sig:

    int strtoken(char *str, char *separator, char *token[])

    for the *token I do this before:

    char *token[256];
    for(int i = 0; i < 256; i++)
    {
    token[i] = '\0';
    }

    I call the function but at this line it crashes:

    token[0] = strtok(str, separator);

    Error on writing etc. (German Error, so I don't know exactly what it's called in english) Can someone help me?

    C / C++ / MFC help data-structures question

  • 10 is not the new 6 (at least so far.)
    E error1408

    Oh no I...must...hide....C++ Book.... :laugh:

    The Lounge c++ visual-studio csharp beta-testing tools

  • The best possible ref for CSS
    E error1408

    I never saw it before, but I think it's a really great source of inspiration and I'm sure I can learn a lot from it.

    The Lounge css com question discussion

  • What IDE for C++?
    E error1408

    Ok and why do you think I should use vi, gvim, or BBEdit? What are the special features? Do they provide code completion or sth. like the Intelli-Sense in VS? C# and other languages[^]

    C / C++ / MFC csharp c++ java visual-studio question

  • What IDE for C++?
    E error1408

    Thank you very much!!

    C / C++ / MFC csharp c++ java visual-studio question

  • What IDE for C++?
    E error1408

    Hi, I want to learn DX10 and C++, I know C#, Java etc. So I also know VS2008 EXPRESS as IDE for C#. But is it as good for C++ as well? I'd like to know what you think, which IDE is best for developing with C++ and why? Thx

    C / C++ / MFC csharp c++ java visual-studio question

  • Is Regex faster?
    E error1408

    Ok i wrote a little app that compares the two methods. I found out, that testing a file with 60000 lines 30 times took my pc about a second with this method: using (StreamReader rIn = new StreamReader("test.txt")) { string line = ""; while ((line = rIn.ReadLine()) != null) { if (line.Trim() == "{{{tcl") { return true; } } rIn.Close(); } return false; and about 9 seconds with the regex: using (StreamReader rIn = new StreamReader("test.txt")) { string line = ""; Regex reg = new Regex(@"\s*\{\{\{tcl\s*"); while ((line = rIn.ReadLine()) != null) { if (reg.IsMatch(line)) { return true; } } rIn.Close(); } return false; Thats a BIG difference.

    C# regex tutorial question

  • Is Regex faster?
    E error1408

    Hi, if you had to search 50000 lines of code for the word example as fast as possible, with every kind of whitespace in the line, which method would you prefer. REGEX or myString.Trim() == "example"

    C# regex tutorial question

  • Static Method to get Data from DB?
    E error1408

    Thank you very much!:-D

    ASP.NET question database

  • Static Method to get Data from DB?
    E error1408

    Hi, if i make a static method, that gets Data from my DB, will the method be threadsafe? I mean while one user requests some data and the method is running, can another user that wants to do the same, read/write the variables in this static method? I know it's a beginners question, i searched a lot but i didn't find an answer. Thanks for helping me in advance.

    ASP.NET question database

  • How to add xml-Stylesheet line to xml-file? [modified]
    E error1408

    THANK YOU. You're the man! Why didn't i see it before? At last the ugly code can be banished! Hurray :)

    led mike wrote:

    You should probably provide that information in your initial post.

    Yes perhaps :)

    XML / XSL xml tutorial question

  • Strange Problem at writing file
    E error1408

    Thank you very much.

    Luc Pattyn wrote:

    The solution: 1. either use a different file name 2. or remove all background reader candidates (bad idea) 3. or implement the retry loop as Explorer has it (use a Windows.Forms.Timer for this)

    1. and 2. are no solutions for me. I have to try 3. I think. I hoped i don't have to use a timer :(

    C# help question xml

  • How to add xml-Stylesheet line to xml-file? [modified]
    E error1408

    I searched the documentation for my problem. And i found nothing. I checked every method. And because i found nothing, i asked you.

    XML / XSL xml tutorial question

  • Strange Problem at writing file
    E error1408

    I tried it. But it doesn't have an effect. Here is my code at the moment:

    //some loop
    XmlDocument doc = new XmlDocument();
    doc.Load(FullFilePath);
    .......//do sth.
    doc.Save(FullFilePath); //<-There the error happens
    //end of loop

    C# help question xml
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups