Thread: last element of buffer I get garbage, instead of value

  1. #1
    Registered User
    Join Date
    Apr 2017
    Posts
    51

    last element of buffer I get garbage, instead of value

    I have a buffer:
    Code:
    12-OCT-17  49      412034  658909NH5   NDSHSG  3.55                S2  10122017   10162017   0                         11000                     2422811790101                 3.416             11110
      36.88                     USDUSDRTSMUNI2        0                           031                           N            ND  0                         0         0       0       0  17:3107012026   100                PN  17:31:400
    REGV-MUNIX
    510 bytes long
    last ELEMENT
    Code:
    REGV-MUNIX
    is 50 chars long

    I have a structure, the last element is 40 chars long
    but after I get it from mq TO STRUCTURE, all elements are OK, but the last a get :
    Code:
     trd_sysmat_intliser_bnk_id_cd =                                                       ^OÿÿÿÿÿÙ`^OÿÿÿÿÿÝ0
    o you know, why?

  2. #2
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    1,111
    You would need to show your code in Code tags before we can attempt to see your problems.

    Please read the Forum Rules FAQ.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting the same element vs getting random element.
    By Haratino in forum C Programming
    Replies: 2
    Last Post: 03-01-2016, 11:09 AM
  2. Insert element after the last element in array in c
    By amaturequestion in forum C Programming
    Replies: 3
    Last Post: 04-09-2015, 08:29 AM
  3. Class for both dynamic allocated buffer and static buffer
    By TotalTurd in forum C++ Programming
    Replies: 3
    Last Post: 01-07-2012, 09:09 PM
  4. vector remove element of element
    By Ducky in forum C++ Programming
    Replies: 6
    Last Post: 09-12-2010, 03:24 PM
  5. fgets(buffer,sizeof(buffer),stdin);
    By linuxdude in forum C Programming
    Replies: 2
    Last Post: 10-28-2003, 10:41 AM

Tags for this Thread