8 Topics

Member Avatar for
Member Avatar for tanatos.daniel

I have this simple program in which I want to concatenate two char pointers using memcpy, but I get access violation writing location on the memcpy line. Why is this happening and what could be done to make it work? Thanks. char *first = new char[20], *second="world!"; printf("first: "); scanf("%s",&first); …

Member Avatar for Ancient Dragon
0
539
Member Avatar for ram619

What is the maximum buffer size allowed in memecpy() function in c, I am using GCC compiler,32-bit system, What is the affecting factor for memcpy failure? ->Alignment issue? ->Size? however the buffer size 256bytes not working, tried 160 bytes copy which fits our requirement

Member Avatar for ram619
0
3K
Member Avatar for fyra

Hi. Nice to meet you. I'd like to know if I'm doing the allocation of memory from data to new_data correctly and why new_data only has one value since the memory of data was copied before to new_data. set size: 10 set[000] = 000 set[001] = 001 set[002] = 002 …

Member Avatar for fyra
0
277
Member Avatar for James19142

I used `memcpy` to copy the contents of one pointer to another pointer assigned to new memory. Later in the program I get runtime errors as if I were attempting to operate on a pointer pointing to nothing. While debugging, I saw that the original and the the copied pointer …

Member Avatar for James19142
0
2K
Member Avatar for FearlessHornet

I have been working on a few projects and needed a method similar to pythons string.split(). I decided to make a reusable piece of code and export it as a .dll, the code is below: std::vector<std::string> Editor::StringHandler::Split(std::string data, std::string tokens) std::vector<std::string> returnList; std::string temp=""; bool found=false; for (auto i : …

Member Avatar for FearlessHornet
0
542
Member Avatar for mhirschb

Hi all, I am currently extending a large C project with an own extension and I am stuck in a pointer/array/struct problem: The project offers a struct of this structure [CODE]struct ip_addr{ unsigned int af; /* address family: AF_INET6 or AF_INET */ unsigned int len; /* address len, 16 or …

Member Avatar for nezachem
0
177
Member Avatar for hanvyj

I am writing a video program, everything works fine except I am often (ie most times, but not [I]every [/I]time) getting the following error: Unhandled exception at 0x6076fde0 (msvcr90d.dll) in javaw.exe: 0xC0000005: Access violation reading location 0x0a450020. I have tracked it down to this function: [CODE]//fill the buffer from data …

Member Avatar for hanvyj
0
5K
Member Avatar for mrinal.s2008

Hi, the code analysis tool we use gives below warning for the functions in which memset / memcpy is used "The function writes outside the bounds of dup on line 303, which could corrupt data, cause the program to crash, or lead to the execution of malicious code." could someone …

Member Avatar for Fbody
0
219

The End.