Search:

Type: Posts; User: Scarlet7

Page 1 of 7 1 2 3 4

Search: Search took 0.01 seconds; generated 33 minute(s) ago.

  1. Replies
    2
    Views
    3,930

    realloc may move the memory block to a new...

    realloc may move the memory block to a new location, whose address is returned by the realloc function.

    So you should be using the returned pointer from realloc when calling strcat.
  2. Replies
    1
    Views
    1,068

    Lookup CreatFile(), ReadFile() and WriteFile(),...

    Lookup CreatFile(), ReadFile() and WriteFile(), for example:


    char Data[1]; // ? a byte or what ever size you need etc...
    int BytesWritten, BytesRead;
    HANDLE hComPortHandle;

    // To read...
  3. Replies
    2
    Views
    5,183

    The 'for' loop will loop forever, i is set to...

    The 'for' loop will loop forever, i is set to slen but not used, but then incrementing and decrementing the s pointer on each loop.


    for(i = slen ; s > 0; s--)
    {
    s++;
    }

    Have a look at...
  4. Replies
    13
    Views
    7,319

    You will properly need to do something along the...

    You will properly need to do something along the lines of the following skeleton code. Create the socket then pass the connection to a receiving thread to handle while the main thread listens on...
  5. Replies
    8
    Views
    4,103

    char Text[80] = {0}; char * line = "GET...

    char Text[80] = {0};
    char * line = "GET /send.htm?Text=START HTTP/1.1";

    char *s,*t;

    if(s = strchr(line, '='))
    {
    if(t = strchr(s, ' '))
    strncpy(Text, s+1, t-s);
    }
  6. #include "switchfileio.h" using namespace std;...

    #include "switchfileio.h"

    using namespace std;

    The using namespace is after the included header, either place before the header include or move into the header.
  7. Replies
    5
    Views
    1,424

    Move the prototype from the header to that.c and...

    Move the prototype from the header to that.c and create another in this.c with an extern.


    extern void sayHello();
  8. What reaction were you expecting, or hoping for...

    What reaction were you expecting, or hoping for on a left mouse button?

    If to bring the NotePad to the top window the use the following:


    SetForegroundWindow( hTargetWnd );

    If to set...
  9. Replies
    9
    Views
    1,268

    Try using fwrite intead of fprintf: ...

    Try using fwrite intead of fprintf:



    fwrite( &patch[i], 1, 1, file);
  10. If you have the handle to the NotePad application...

    If you have the handle to the NotePad application then try posting a WM_CHAR message, for example:



    PostMessage( hTargetWnd, WM_CHAR, 'g', 0 );
  11. Thread: gotoxy

    by Scarlet7
    Replies
    4
    Views
    6,117

    It looks like you may have write the gotoxy()...

    It looks like you may have write the gotoxy() function your self.

    Look up SetConsoleCursorPosition(), if in Windows...
  12. Replies
    8
    Views
    1,084

    The size will be more than 576kb, a float size is...

    The size will be more than 576kb, a float size is 4 bytes.

    576kb * 4 = 2.3mb
  13. Thread: Beginner help

    by Scarlet7
    Replies
    7
    Views
    1,153

    The next pointer in head needs to be set to NULL...

    The next pointer in head needs to be set to NULL after the first malloc:

    head->next = NULL;
  14. The call to str.c_str() is within the string...

    The call to str.c_str() is within the string "c:\\str.c_str()\document1.txt" will be treated as a string.

    You need to create the string:

    "c:\\" + str.c_str() + "\\document1.txt"

    And also for...
  15. Replies
    6
    Views
    1,086

    Hi, Yes I known my solution is not desirable,...

    Hi, Yes I known my solution is not desirable, but, I was answering the question that was being asked i.e. using a variable length array and passing arrays as function parameters, by using the example...
  16. Replies
    6
    Views
    1,086

    All that needs to be done is to allocate the...

    All that needs to be done is to allocate the array then delete when finished with, and no need for globals.


    void numbers(int *array1, int arraylength){
    for (int i = 0;i < arraylength;i++) {...
  17. Replies
    4
    Views
    1,440

    char s[] = ""; You've still got a problem...

    char s[] = "";

    You've still got a problem because you're not allocating enough memory for the 's' char variable. This will only allocate 1 byte for the '\0'
  18. Hi, I compiled with Micrsoft Visual C++ 6..

    Hi, I compiled with Micrsoft Visual C++ 6..
  19. I just tried your code and got Output :...

    I just tried your code and got Output : [sihTsiesrever]
  20. Replies
    8
    Views
    5,181

    or like this, using pointers.. char *pi...

    or like this, using pointers..



    char *pi = input;
    char *po = output;

    do
    {
    if(isspace(*pi) && isspace(*(pi+1)))
  21. Replies
    8
    Views
    5,181

    You need to check for more than one space in a...

    You need to check for more than one space in a row and terminate the output string with '\0', that's what's causing the funny characters at the end.



    while(input[i])
    {
    ...
  22. Replies
    6
    Views
    2,457

    If test1.txt has multiple lines then the code...

    If test1.txt has multiple lines then the code will count the new line character '\n' or 0x10 and increment 'other_char'. You need to add some code to check for '\n' and not increment 'other_char'....
  23. Replies
    6
    Views
    2,457

    > else if (c >= 'a' && c >= 'z') c >= 'z' ...

    > else if (c >= 'a' && c >= 'z')

    c >= 'z'

    should be

    c <= 'z'
  24. Replies
    4
    Views
    7,269

    In the WinApp::InitInstance() call...

    In the WinApp::InitInstance() call GetCommandLine(), which returns a pointer to the command-line string for the current process. Load the file using the file name that’s contained within the 2nd set...
  25. Replies
    4
    Views
    1,836

    You're allocating memory using a local, which is...

    You're allocating memory using a local, which is allocated from the stack. When the function ends the memory on the stack is freed. So you need to allocated the memory using 'new', and when no longer...
Results 1 to 25 of 171
Page 1 of 7 1 2 3 4