Search:

Type: Posts; User: xwielder

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    798

    char *getText(); void someFunction(void) { ...

    char *getText();

    void someFunction(void)
    {
    char *msg = getText();
    if (msg)
    {
    printf("%s", msg);
    free (msg);
    }
  2. Replies
    8
    Views
    1,029

    Parentheses weren't mean as a literal, they were...

    Parentheses weren't mean as a literal, they were there for easier readability. You can do this though


    void someFunction(void)
    {
    int c = 123;
    }


    But you are correct, "void()" is...
  3. Replies
    8
    Views
    1,029

    No, a void() function can simply "return;", or...

    No, a void() function can simply "return;", or doesn't even need a "return;" at all. Anything OTHER than a void() function, needs to return whatever you're casting the function as.

    Fore example:...
  4. Replies
    8
    Views
    1,029

    Yes, it'll work fine, but there's no reason for a...

    Yes, it'll work fine, but there's no reason for a return value because you're not assigning the return value of extend() to anything in main(). Since you're not using the return value, just make...
  5. Replies
    4
    Views
    798

    free()ing a _strdup'd value correctly?

    In this EXAMPLE, am I free()ing this _strdup()'d return value correctly?



    char *getText();

    void someFunction(void)
    {
    char *msg = NULL;
    msg = &*getText());
  6. Replies
    6
    Views
    2,408

    *solved*

    Thank you. (1,8) works perfect.

    Only reason I did (0,9) is because if I did (0,8), I would get "XGCa:00"

    Thank you, Salem, for pointing out (1,8). This has resolved my issue.
  7. Replies
    6
    Views
    2,408

    Yes, correct. And when I do Substring(0, 4),...

    Yes, correct. And when I do Substring(0, 4), everything works great. My mistake totally. I suppose my "example" works fine, but here's my 'real' code that puzzles me.

    When I run the following...
  8. Replies
    6
    Views
    2,408

    String Comparison Issues

    If I have the following test code:



    String content = "This is a test";
    String str = "This";
    String lookFor = content.Substring(0, 5); // "This"
    Boolean found = false;

    // "found" should...
  9. I think that I figured it out. Well, it *seems*...

    I think that I figured it out. Well, it *seems* to be working, although I'm not sure if I could/should have done it a better way.

    Here's what I have now:

    In "MainWindow.xaml.cs":


    ...
  10. Function from .cs file calling function from a different .cs file

    What I am trying to do (in brief terms):
    I have a function in a .cs file (A) that needs to access a function in a different .cs file (B). Based on certain calculations, (B) will alter (A)...
  11. Replies
    3
    Views
    5,075

    Okay, so I add: this.myTextBox.FontFamily...

    Okay, so I add:



    this.myTextBox.FontFamily = mFontCollection.Families[0];


    And get this error:
    error CS0029: Cannot implicitly convert type 'System.Drawing.FontFamily' to...
  12. Replies
    3
    Views
    5,075

    Font Embedding to TextBox

    I have successfully loaded a .ttf font. Now, how do I use it in a TextBox?

    FILE: MainWindow.xaml.cs


    namespace myNameSpace
    {
    /// <summary>
    /// Interaction logic for MainWindow.xaml...
  13. Replies
    13
    Views
    3,400

    Yeah, typical. Heh, I suppose every forum has...

    Yeah, typical. Heh, I suppose every forum has 'em. After taking a brief moment to read through some of your recent responses to posts, your arrogance and rudeness toward others is quite evident.
    ...
  14. Replies
    13
    Views
    3,400

    "...It is impossible for you to win this argument...

    "...It is impossible for you to win this argument with me, so stop trying, because it's not even an argument..."

    Wow, and where did all that pent up anger come from? I personally don't recall...
  15. Replies
    13
    Views
    3,400

    Not necessarily. It's more C than C++. It's a...

    Not necessarily. It's more C than C++. It's a mix of both.
  16. Replies
    13
    Views
    3,400

    Capitalize first letter of a word (function)

    I need to pass a word to a function and have the first letter in that word "displayed" back to the user as a capital letter, the rest lower case.

    I say "displayed" because I DO NOT want to change...
  17. Replies
    7
    Views
    978

    I completely understand, and agree. Because I'm...

    I completely understand, and agree. Because I'm in a pinch though, I (unfortunately) have to use the same name. I just needed confirmation that I wouldn't run into any memory or technical issues. ...
  18. Thread: Beginner to C

    by xwielder
    Replies
    3
    Views
    1,056

    "C for dummies" and/or "C++ for dummies" helped...

    "C for dummies" and/or "C++ for dummies" helped me when I started out with C. Lots of good tutorials and best of all, checked the book out from the library so I didn't spend a dime.... (besides the...
  19. Replies
    7
    Views
    978

    Just needed to know if it's safe. I have to do...

    Just needed to know if it's safe. I have to do it for what I'm implementing. Thanks for the reply. (unless you could point out as to why I shouldn't do it, I guess I'm confused about: It's safe,...
  20. Replies
    7
    Views
    978

    double declaring?

    This seems to work fine with no issues:


    const int WORK_skill = 46;

    #define WORK_skill(data) (data)->myStruct.element


    The const int WORK_skill is, well, just an int and has absolutely...
  21. Replies
    2
    Views
    848

    Excellent. Thank you. I'm trying to eliminate...

    Excellent. Thank you. I'm trying to eliminate as many _strdup's as possible so I don't have to "free" them later.
  22. Replies
    2
    Views
    848

    _strdup on an atoi necessary?

    Here is my struct


    struct pdat {
    struct playerQuestInfo questData;
    };

    struct playerQuestInfo {
    int questID[MAX_QUESTS_PER];
    char *questObjectiveType[MAX_QUESTS_PER];
  23. Replies
    17
    Views
    3,848

    Got it... mostly. Thank you both for thorough...

    Got it... mostly. Thank you both for thorough reviews and helpful advice.
  24. Replies
    17
    Views
    3,848

    Well, I just tried this: std::string...

    Well, I just tried this:



    std::string sql(const char *dataIn)
    {
    std::string returnVal = "";
    char *to = new char[(strlen(dataIn) * 2) + 1];
    ...
  25. Replies
    17
    Views
    3,848

    Interesting... I was just doing some testing with...

    Interesting... I was just doing some testing with double quotes and single quotes regarding your point.

    The program constantly crashes when I use single quotes. (Seems to break on malloc.c...
Results 1 to 25 of 55
Page 1 of 3 1 2 3