I have the following code, so far, I want to check if a file name is already in the linked list fileList (or flist). according to the output, the string saved in the first Node was changed somewhere in Node* getFileName(Node *&flist) How did this happen? Also, is there anything else that I'm doing is wrong or not safe regarding pointers ...
We are designing a p2p applications using c++ which transmits voice to other peer using UDP.
We are capturing a mic signal in a buffer in the thread which captures voice for one second in the while loop. For every second voice captured in buffer it splits it into packets and sends to the other peer. Now I need a proper data structure a...
I simply don't see why this error's popping up.
Widget.cpp: In constructor 'Widget::Widget(Generic, char*, int, int, int, QObject*)':
Widget.cpp:13: error: invalid conversion from 'const char*' to 'char*'
Nowhere do I have a 'const char*' in terms of Widget's constructor.
class Widget: public QObject {
Q_OBJECT
Q_PROPERTY(ch...
Every time I try to use my add function and return a list from it. I get an undefined symbol error. What am I doing wrong here.
this is the error:
Undefined first referenced
symbol in file
add(std::list<int, std::allocator<int> > const&, std::list<int, std::allocator<int> >)/var/tmp//...
I'm currently working on cleaning up an API full of function templates, and had a strong desire to write the following code.
template <typename T, typename U, typename V>
void doWork(const T& arg1, const U& arg2, V* optionalArg = 0);
When I invoke this template, I would like to do so as follows.
std::string text("hello");
doWork(100,...
Are there any facilities in SDL or C++ that allow you to read image files in from a folder without specifying their name, like reading them in sequential order, etc.? If not are there any techniques you use to accomplish something along the same lines?
Doing something like this:
foo_ani[0] = LoadImage("Animations/foo1.png");
foo_ani[1]...
Hey I'm trying to extract the file path but the problem is that I'm stuck in an infinite loop don't understand why. Please have a look at my code.
CString myString(_T("C:\\Documents and Settings\\admin\\Desktop\\Elite\\Elite\\IvrEngine\\dxxxB1C1.log"));
int pos = myString.Find(_T("\\"));
while (pos != -1)
{
pos = myString.Find(_T(...
I've been tinkering with SQLite3 for the past couple days, and it seems like a decent database, but I'm wondering about its uses for serialization.
I need to serialize a set of key/value pairs which are linked to another table, and this is the way I've been doing this so far.
First there will be the item table:
CREATE TABLE items (id ...
can power function be used to calulate the power of very large values like pow(200,200).
also can it be used for long long int values ... pow(long long int,long long int).
i am getting this error
/sources/tested.cpp: In function 'int main()':
/sources/tested.cpp:16: error: call of overloaded 'pow(long long int&, long long int&)' is amb...
I'm new to OOP, so please bear with me if this is a simple question. If I create a class, which has attributes "a", "b", and "c", is it possible for the attributes to be an array, such that attribute a[2] has a meaning?
...
I want to compile this application in command prompt (Windows):
include "QtGui/QApplication"
include "QtGui/QMainWindow"
class Form1 : public QMainWindow
{
Q_OBJECT
public:
Form1(QWidget *parent = 0, Qt::WFlags flags = 0);
~Form1();
};
Form1::Form1(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags)
{
...
I'm writing a state manager for a game. I've got most of the logic down for how I want to do this.
I want states, which will be classes, to be handled in a stack in the StateManager class. Each state will have pause functions, and the stack will be an STL stack.
When a state is done with what it needs to do (example: from the pause scre...
Hi,
I'm having a debate with a friend and we're wondering why so many open source projects have decided to go with C instead of C++. Projects such as Apache, GTK, Gnome and more opted for C, but why not C++ since it's almost the same?
We're precisely looking for the reasons that would have led those projects (not only those I've listed...
One of my projects is making use of Microsoft's supplied memory leak checker via _CrtSetDbgFlag etc. This is working fine except that I now want to make use of a third-party package which is leaking a small amount of memory. I have no particular need to fix the leaks, but the output is annoying since it will disguise "genuine" leaks that...
I understand the purpose and reasoning behind precompiled headers. However, what are the rules when implementing them? From my understanding, it goes something like this:
Set your project up to use precompiled headers with the YU directive.
Create your stdafx.h file and set that to be your precompiled header.
Include this as the top ...
I'm using Code::Blocks 8.02 and the mingw 5.1.6 compiler. I'm getting this error when I compile my Qt project:
C:\Documents and Settings\The
Fuzz\Desktop\GUI\App_interface.cpp|33|undefined
reference to `vtable for AddressBook'
File AddressBook.h:
#ifndef ADDRESSBOOK_H
#define ADDRESSBOOK_H
#include <QWidget>
class QLabel...
After a successful call to both LogonUser and ImpersonateLoggedOnUser it doesn't appear that my process is running as the new user...
system("whoami");
prints out:
Chris-PC\Chris
when it should be:
Chris-PC\LimitedGuy
Is there a function I'm not calling or something?
My code:
if(argc == 6) // impersonate
{
printf("[~] Logging...
As the title states, I'm not sure why I'm getting this error. I've put together a test.cpp that's similar to this structure, and it works fine. Also, other than the vector problem, there's the other problem about 'protected', which isn't even in the code. I think 'protected' is a macro, so no telling what's there. I'm new to QT, so I'm l...
I have a vector of Student objects which I want to sort using #include <algorithm> and sort(list.begin(), list.end());
In order to do this, I understand that I need to overload the "<" operator but after trying (and failing) with several methods suggested online, I am running out of ideas.
Here is my latest attempt:
In Student.h...
....
In my code, I have a vector of Student objects.
vector<Student> m_students;
I want to:
Check to see if the vector contains any Student of a certain name.
If no such Student exists, add a new one.
Add data to the Student of that name.
Consider the following code:
// Check to see if the Student already exists.
Student* targetStuden...