Assuming you are making the memcpy_s call from your code as it appears.
Are you passing a valid pointer to memcpy_s?
Also, it would be useful if you showed us the relevant part of your code where this is happening.
For now, lets ignore the second part until you post some code. They may not be related.
Regards,
Alex.
User Profile
Collapse
-
I feel you on this.
Been working myself on a huge application written most parts in C and symbol names in a language I don't speak. It's a mess. No documentation, hundreds of tables and the devs who know it all after years of trying are not willing to assist. They know the ins and outs and they want for some reason to keep it that way. It's very DARK.
The good part for me is I don't have to deal with tight deadlines and...Leave a comment:
-
To use or not to use threads
Hello people,
I have to optimize a very slow C program that does some processing on some data from a Db, creating some xml files. It has to work with a fairly large data set and is quite slow.
The original programmer used threads for this processing, putting items in input queues that the threads keep checking for, processing and passing to the next queue.
There are other bottlenecks (aside from the threading... -
Okay then, I imagined so too. Go ahead and check out that link.
Get back here if you get into any problems. Good Luck!
Alex.Leave a comment:
-
This more has to do with Java than C/C++, better to ask this kind of question on the Java forum...
Also you could do this in pure Java. Is there any specific reason for using native code?
There is a wealth of information that you may want to look at here.
King Regards,
Alex.Leave a comment:
-
It depends on how the string is presented. I assume you are using C and Name and Surname are separated by a space.
You could loop through the characters in the string starting at index 0. and search for the space character. Meanwhile you are storing the characters you find in another string. Once you find a space character, you have the Name. By continuing to the end of the string which is denoted by the Null terminator i.e '\0' you...Leave a comment:
-
It works because where there is no type, C defaults to int. So your function is similar to one that explicitly declares an int return type.
This behaviour is actually removed from the current C standard but compilers still support it for the sake of old code. It should not be relied on in new code.
Actually you could even have a variable like this...Code:mytyplessvar = 0; //This will actually be treated as an int.
Leave a comment:
-
First, it's not correct to infer that since the output is not created, your program reads the input file endlessly.
Other things would cause it not to be created. At a glance, you should not use ifstream for the output file. You use ofstream or simply fstream for a read/write file.
Also it's not nessesary to check for eof on an output file. You simply don't care since you should never get to eof. If you are paranoid, maybe...Leave a comment:
-
-
-
You use a file or database. When you program is ran, it stores/writes/saves what you want in the file or database. The next time your program is ran, it reads what is in the file or database.
If you don't know how to write data to a file or a database, you need to find that out.
Kind Regards,
Alex.Leave a comment:
-
A few questions for you to make it clearer...
What exactly do you mean fgets() gets executed before any of the code is ran?
Do you say you do not see anything printed by the printf()?
What would you rather was executed first?
Kind Regards,
Alex.Leave a comment:
-
The size of char on most systems is generally 1 byte long. One KB = 1024 bytes, so a declaration such asCode:char kb[1024];
You could do something similar for a GB but you have to be careful about where the memory comes from.
Local variables will be allocated on the part of memory known as the Stack which is considerably limited on most systems so you could get errors like Stack Overflow if you allocate...Leave a comment:
-
Web Marsharl and Windows workstation internet trouble
I have this elusive problem that I can't seem to get my fingers on.
This is the senario:
I am working at a client's site (am a developer) and they have assigned me this nice little HP-Compaq machine that am using.
The have a domain with a proxy, and stuff.
I have pretty elevated domain rights, admin and all.
I can(should) browse the internet normally without any problems.
Now here's... -
You are right. Taskman only shows the 'Physical memory' procexp calls it 'Working memory'. Actually I had tried procexp too and found this 'Working memory' to be the same as what taskman reported, but when you mentioned it, I checked it again and realised I had to enable a column that shows the virtual memory size (called just 'virtual size' by the program) that shows the entire 2gb allocated to the process. I had read about this 2gb-program and...Leave a comment:
-
Banfa, what about if his code was under main? Is main treated just like any other function (the first) and the automatic variables allocated on the stack?
Incidentally just today I was trying to find out the entire memory available on a programs heap on my windows (with g++ on mingw) and I could allocate an array of char[125000] 17029 times and failing on the 17030th array. That's almost 2gb. My laptop (on which I was doing this) has...Leave a comment:
-
Yes, you need to. Though you don't necessarily have to. The only thing your current code does is print out a string. It makes no difference whether you have
orCode:string bla = "blablablablablablabla...............going very far straight..........";
Regards,
Alex....Leave a comment:
-
-
Using C function pointer with c++ member func pointer
Hello everyone.
I am using a C library from C++ code. The C library declares some function pointers using typedef, and then makes some variables using this function pointer as the type. Like:
Code:typedef void (*func) (int); //then the pointer... func ptr;
... -
It's always a good idea to verify your assumptions in the code.
For example, why do you assume that what you are passing to parseInt is actually an integer. Or even that there is something in the string at position 32 or wherever.
What if the string is just 20 characters long?
Regards,
Alex.Leave a comment:
No activity results to display
Show More
Leave a comment: