Sounds easy, but I've got a bug and I'm not sure what's causing it?
nopunccount = 0;
char *ra = new char[sizeof(npa)];
while (nopunccount <= strlen(npa)) {
ra[nopunccount] = npa[strlen(npa) - nopunccount];
nopunccount++;
}
ra never gets a value into it and I have verified that npa has char values to provide within the nopunc...
Hey,
i just want to check, if the iterator points on an object in a list.
What's the cmd?
Thank you. :)
SkyThe
EDIT:
Hmm,.. ok i tried it.
Now there is a Error: "Expression: list iterators incompitable"
Maybe some code:
#include <list>
list<obj> list;
list<obj>::iterator it;
if(it != list.end()){ //here the error pops up when i ...
Ive got some data (not that the data actually exists until after I solved this...) I need to be able to manipulate within my program. However I cant work out a suitable structure for storing this in.
The data represents a set of paths and nodes. There is one input (which may in some cases no be present) then a number of paths between no...
std::ostringstream parmStream;
char parmName[1024];
THTTPUrl::Encode(parmName, pParm->Name().c_str(), 1024);
//I want to add the value of the paramName to the parmStream worked b4 when parmName was a string but obv not now
parmStream << "&" << parmName + "=";
Gives me the following ..
error: invalid operands of types \u2018char ...
Hello guys, I am trying to create a static library in Xcode using C++ ( All my files are .h or .cpp ).
I tried deleting main.cpp and then adding a target to my project to build a "Static" library. Since I'm not using Cocoa, I assumed that I needed to add a BSD Static Library, but I have tried other static library options with no apparen...
Hello all
my question is about sybase's ct_get_data() function
i got below message when fetching TEXT data that is is not the last column of the result set.
Open Client Message:
Message number: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (61)
Message String: ct_get_data(): user api layer: external error: Item of 1 is not greater th...
Hello all,
I soon started a small C++ project and elaborated some naming convention rules for variables, according to scope.
I made class members _prefixed_with_underscore and methods parameters suffixed_with_underscore_. I soon got neurotic about inventing naming conventions for everything, like global variables (ok, those might be im...
vector<vector<string> > test for example.
g++, you can do
test.reserve(10);
test[0] = othervector;
test[9] = othervector;
It doesn't crash. Theory says you shouldn't do it like that because you are assigning a vector to a chunk of memory that believes it is a vector.
But it works just like the next one:
#include <string>
#include <...
I am looking to find a way to programatically (C++) control/secure access to the USB ports on a Windows CE device that will only have a single login, and then be left running a real-time application.
Ideally, being able to have a password entered into the running application, which then opens up/enables USB functionality, would be the e...
Hi,
PostSharp 2.0 includes a CLR host and implements IHostAssemblyStore::ProvideAssembly.
From managed code, I invoke:
Assembly.Load("logicnp.cryptolicensing, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=4a3c0a4c668b48b4")
My implementation of IHostAssemblyStore::ProvideAssembly receives the following input for ...
I don't know what's wrong with the follwing code, it should read numbers and put their value with the position together in a vector of pairs and then sort them and print out the positions. I removed the part with sort - i thought the problem was there, but i received an error on compilation again.
#include <iostream> ...
I'm reading Thinking in C++ by Bruce Eckel. In Chapter 15 (Volume 1) under the heading "Behaviour of virtual functions inside constructor", he goes
What happens if you’re inside a
constructor and you call a virtual
function? Inside an ordinary member
function you can imagine what will
happen – the virtual call is resolved
a...
Why does the following not work:
#include <iostream>
#include <fstream>
#include <stack>
std::stack<std::ifstream> s;
-PT
...
Trying to decode the SDP sprop-parameter-sets values for an H.264 video stream and have found to access some of the values will involve parsing of Exp-Golomb encoded data and my method contains the base64 decoded sprop-parameter-sets data in a byte array which I now bit walking but have come up to the first part of Exp-Golomb encoded dat...
I was playing around with istream iterators and exception handling a few days ago and I came across with this curiousity:
#include <iostream>
#include <fstream>
#include <iterator>
#include <algorithm>
using namespace std;
int main(int argc, char* argv[])
{
if (argc < 2) {
cout << argv[0] << " <file>" << endl;
return -1...
Background Information: Ultimately, I would like to write an emulator of a real machine such as the original Nintendo or Gameboy. However, I decided that I need to start somewhere much, much simpler. My computer science advisor/professor offered me the specifications for a very simple imaginary processor that he created to emulate first....
I have the following code:
void * storage = malloc( 4 );
__asm
{
//assume the interger 1 is stored in eax
mov eax, storage //I've tried *storage as well but apparently it's illegal syntax
}
/* other code here */
free(storage);
However, in the code, when I dereference the storage pointer ( as in *(int *)storage ), I do not ge...
Does anyone know what the "-FC" option does in g++?
I have it in my SConstruct script that builds the command line g++ command, I have searched google
...
If I allocate memory in one thread in C++ (either new or malloc) can I de-allocate it in another, or must both occur in the same thread? Ideally, I'd like to avoid this in the first place, but I'm curious to know is it legal, illegal or implementation dependent.
Edit: The compilers I'm currently using include VS2003, VS2008 and Embedd...
Hi
I want to get a notification each time a new process is started by the operating system.
Note that I need to that in native code (I know it can be done in managed code using System.Management members).
Extra points if there is a way to get it before the process starts running :) (i.e in during its initialization)
Thanks.
...