Click here to Skip to main content
15,887,355 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Look and Feel [modified] Pin
FarPointer7-Jun-06 3:31
FarPointer7-Jun-06 3:31 
GeneralRe: Look and Feel Pin
Andy Rama13-Jun-06 3:50
Andy Rama13-Jun-06 3:50 
GeneralRe: Look and Feel Pin
FarPointer13-Jun-06 21:11
FarPointer13-Jun-06 21:11 
AnswerRe: Look and Feel Pin
ThatsAlok7-Jun-06 22:24
ThatsAlok7-Jun-06 22:24 
QuestionMediaplayer and COM Pin
TheMason7-Jun-06 3:04
TheMason7-Jun-06 3:04 
AnswerRe: Mediaplayer and COM [modified] Pin
_AnsHUMAN_ 7-Jun-06 3:30
_AnsHUMAN_ 7-Jun-06 3:30 
AnswerRe: Mediaplayer and COM Pin
TheMason8-Jun-06 5:36
TheMason8-Jun-06 5:36 
Question'The heck? How is 14==4? Pin
Lord Kixdemp7-Jun-06 2:11
Lord Kixdemp7-Jun-06 2:11 
Hello everyone!

Look at my function:

/* getPartName: Returns the filename for a part<br />
 * fileName:    Original file's name<br />
 * part:        Part number (-1 is the .mtx file) */<br />
char * getPartName(char * fileName, int part)<br />
{<br />
    // Debug printf<br />
    printf("%i\n", sizeof(fileName));<br />
    <br />
    /* partName:    Filename of part<br />
     * numExt:      Extension number (000-999, see below)<br />
     * partStr:     String representation of part file<br />
     * unexName:    Original filename without extension */<br />
    char *partName, *numExt, *partStr, *unexName;<br />
    int remSpace;<br />
    <br />
    /* Put the unextended name on it and add space for the extension */<br />
    partName = malloc(sizeof(char) * (sizeof(getUnextendedName(fileName)) + 4));<br />
    <br />
    /* Add the name to it */<br />
    strcpy(partName, getUnextendedName(fileName));<br />
    <br />
    /* Do they want the main file? */<br />
    if (part == -1)<br />
        strcat(partName, ".mtx");<br />
        <br />
    /* Or a part file? */<br />
    else<br />
    {<br />
        /* Allocate memory for 4 chars (.xxx) */<br />
        partStr = malloc(sizeof(char) * 4);<br />
<br />
        /* Put said chars on it */<br />
        sprintf(partStr, ".%2i", part);<br />
        <br />
        /* Add it */<br />
        strcat(partName, partStr);<br />
    }<br />
    <br />
    return partName;<br />
}


See the debug printf at the top? Well, why does it print out "4"? It's supposed to be 14... Even when I change that printf to display the actual filename it prints out "screenshot.png", so why the heck would it be 4? Anyone know? Thanks!

Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
AnswerRe: 'The heck? How is 14==4? Pin
kakan7-Jun-06 2:15
professionalkakan7-Jun-06 2:15 
AnswerRe: 'The heck? How is 14==4? Pin
Cedric Moonen7-Jun-06 2:15
Cedric Moonen7-Jun-06 2:15 
AnswerRe: 'The heck? How is 14==4? Pin
Alton Williams7-Jun-06 2:33
Alton Williams7-Jun-06 2:33 
GeneralRe: 'The heck? How is 14==4? Pin
Lord Kixdemp7-Jun-06 2:49
Lord Kixdemp7-Jun-06 2:49 
Questioncreating a grid like control using edit control Pin
arunmahe7-Jun-06 1:37
arunmahe7-Jun-06 1:37 
AnswerRe: creating a grid like control using edit control Pin
Cedric Moonen7-Jun-06 1:49
Cedric Moonen7-Jun-06 1:49 
AnswerRe: creating a grid like control using edit control Pin
harilal7-Jun-06 2:01
harilal7-Jun-06 2:01 
AnswerRe: creating a grid like control using edit control Pin
Maximilien7-Jun-06 2:48
Maximilien7-Jun-06 2:48 
AnswerRe: creating a grid like control using edit control Pin
ThatsAlok7-Jun-06 22:41
ThatsAlok7-Jun-06 22:41 
Questionhow to send a custom message to a window service? Pin
sunyw_20067-Jun-06 1:15
sunyw_20067-Jun-06 1:15 
AnswerRe: how to send a custom message to a window service? Pin
Viorel.7-Jun-06 3:28
Viorel.7-Jun-06 3:28 
AnswerRe: how to send a custom message to a window service? Pin
Nibu babu thomas7-Jun-06 18:27
Nibu babu thomas7-Jun-06 18:27 
QuestionUSB-Serial adpater and normal serial communication Pin
Veeresh Hiremath7-Jun-06 0:39
Veeresh Hiremath7-Jun-06 0:39 
AnswerRe: USB-Serial adpater and normal serial communication Pin
Cedric Moonen7-Jun-06 1:23
Cedric Moonen7-Jun-06 1:23 
Questiondate function to mysql Pin
yogendra kaushik7-Jun-06 0:35
yogendra kaushik7-Jun-06 0:35 
AnswerRe: date function to mysql Pin
_AnsHUMAN_ 7-Jun-06 0:45
_AnsHUMAN_ 7-Jun-06 0:45 
AnswerRe: date function to mysql Pin
Laxman Auti7-Jun-06 2:41
Laxman Auti7-Jun-06 2:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.