49,761 Topics
| |
I'm starting to write more intricate code that does some dynamic compilation through Lua and OpenGL. However, my code is starting to get kinda messy because I have many const char* strings and strings in sections of my code so they can be parsed together properly depending on specific conditions. … | |
[code] std::tr1::array<double, 10> alpha; std::iota(alpha.begin(), alpha.end(), 0); using namespace boost::accumulators; size_t const SIZE = 1000000; accumulator_set<double, stats<tag::mean, tag::lazy_variance > > acc; std::for_each(alpha.begin(), alpha.end(), [&](double const VALUE){ acc(VALUE);}); [/code] How could I clear the contents of the acc if I want to evaluate a new mean and variance? Thank you very … | |
i am injecting a dll into oneo my process's and i want it to read the bytes of the file and write those specified bytes to a file on hard disk. The problem is my .dll compiles, but when the .dll isi njected, it never creates the file and writes … | |
i have a header file defined as : [CODE] template <typename NodeElement> class Node{ //public members public: something here..... private: }; template <typename ListElement> class List{ public: something.... Node *nodePtr; //problem here }; [/CODE] [CODE] list.h:38: error: ISO C++ forbids declaration of ‘Node’ with no type list.h:38: error: expected ‘;’ … | |
write a program that accept a txtfile and compress it by removing adjacent duplicate characters. for example if the txtfile contains the line: DID THE BUNNY GET THE MISSISSIPI MAPS FROM BBB then the corresponding output must be: DID THE BUNNY GET THE MISSISSIPI MAPS FROM B.. | |
Say I have something like this [CODE] #include <iostream> #define ICOL 32 using namespace std; int main(int argc, char *argv[]) { ... [/CODE] Is there a way that I can change the value of that global variable within main? Simply saying ICOL = 300; does not work... | |
Hello everyone, I need to know how to import graphics into C++ (Not visual C++) such as .png, .jpg etc. Also, when I say import I don't mean how to make graphics with C++. Thank you everybody!!!! Regards, Gernicha | |
I am VERY novice and working on a school project in C++. I'm not sure where I've gone wrong here in this code. Any advice on why this is not working would be appreciated. Please, pretend like you are talking to someone who knows very little about programming so far. … | |
I have an application in which is compiled on my win32 development machine, but I need this application to be windows 7, 64 bit compatible. How can I do this on my 32bit development machine? | |
I'm attempting to copy a string out of a arbitrary position in a buffer. I can copy out the string but I'm left with a memory leak that I do not know how to solve. Is there a better way to do this; if not, how do I solve the … | |
Ok, im not that much of a geeky smart guy in C++, but i've got some skillz.. so im trying to make a [B]very[/B] [B]simple game[/B] that will randomize 1 number for the computer and 1 number for the person using the program and whomever(person or computer) gets the highest … | |
Hello all, here is the code I came up with for implementing a circular linked list. I get a segmentation fault when I create the list with just one node. With size > 1 circular list works fine! Im not sure but I think it may have something to do … | |
I am having a lot of trouble getting the following to work and I think it is because of file issues: [CODE]int GetMinutes() { fstream file(FNAME); char num[101]; if (!file.is_open()) Error("FILE NOT OPEN!"); file.getline(num,100); file.close(); return atoi(num); } int main(int argc, char *argv[]) { LARGE_INTEGER timestart, timestop, tickspersecond; QueryPerformanceFrequency(&tickspersecond); QueryPerformanceCounter(×tart); … | |
236.cpp(41): this line contains a '{' which has not yet been matched THE CODING IS: #include<iostream> #include<string> #include<conio.h> #include<IOMANIP> #include<fstream> //#include<cctype> //for toupper function using namespace std; class TESTstudent { string name[3]; string sir_name[3]; int roll_no[3]; int count; // FOR LIBRARY string book1[3]; string book2[3]; int dues[3]; int num_book[3]; int … | |
Hi all I'm stuck with this problem for a couple of weeks now, and my normal human brain can't tell me what's going wrong. I've created my own class, inheriting from QThread. Nothing weird in calling it: [CODE] MyThread *thread = new MyThread(); thread->start(); while(thread->isRunning) ; delete thread[/CODE]; I know … | |
Need a little help, I'm trying to run a program that asks the user to enter an integer between 1-50. If given a number between 1 and 50 then echo number then add all integer between 1 and integer entered if user enter an integer not between 1 and 50 … | |
I am attempting to use a different template and write in C++/CLI. The debug file isn't being created for some reason. If I misspell a keyword or enter errors I don't see any red squiggly lines. When I attempt to compile I can't because of an error. C1083: Cannot open … | |
Hi everybody, can someone please explain what is the difference between line A(10) and line B(11).why am i being able to access value of n without using de-referencing operator in first case? [CODE]void fun(void *n) { printf("\n n=%d ", n); } int main() { char nVal = 65; fun((int*)nVal); //-----A … | |
I changed GetDOSEnvironment variable to GetEnvironmentStrings when convering a 16 bit code to a 32 bit one. I got the below error help to resolve the problem mfcs42d.lib(dllmodul.obj) : error LNK2005: __pRawDllMain already defined in SLSOCKET.OBJ Debug/slgsockd.dll : fatal error LNK1169: one or more multiply defined symbols found Error executing … | |
[CODE] #include <iostream> #include <sstream> using namespace std; int main() { int a, b; string s = "34:22"; istringstream ins; ins.str(s); ins >> a >> b; cout <<a <<b; } [/CODE] This is my code and I want to ignore the ":" in string s. The outpout should be 3422. … | |
Alright - this is my conundrum. As a noob to C++ I am only in chapter 9 of my book, having just covered object oriented programs and the exciting world of vectors and arrays. I have an assignment that asks me to run a loop to get and calculate a … | |
Using borlandc [CODE]#include <stdio.h> #include <conio.h> #include <dos.h> #include <stdlib.h> #include <iostream.h> void main() { clrscr(); char x1,x2,name,add,email,occupation; int age,cellno; printf("\tWelcome"); printf("\n\tto"); printf("\n\tVideo City"); printf("\nMembership Registration"); printf("\n\t\tA.New"); printf("\n\t\tB.Old"); printf("\nChoose:"); cin>>x1; clrscr(); { if((x1=='a')||(x1=='A')) { printf("\nRegistration Form"); printf("\nName:"); scanf("%s",&name); printf("\nAdd:"); scanf("%s",&add); printf("\nemail:"); scanf("%s",&email); printf("\nAge:"); scanf("%d",&age); printf("\nOccupation:"); scanf("%s",&occupation); printf("\nCell No:"); scanf("%d",&cellno); clrscr(); … | |
This is a program for displaying image files. I downloaded this program template from Microsoft. I executed the program and open an image file to display, and everything seems to be working fine. However, when I continue to open another image file - which is different from the first one … | |
Hello, I am trying to make a constant iterator data structure, I have a normal Iterator data structure done, but I'm a little stumped with the const iterators.. can you please point me in the right direction? This is my data structure for the iterators: [CODE] template <typename T> class … | |
Write a program in c++ that read two files A.txt and B.txt, and find all words which are in file A.txt but not in file B.txt. Input: A file containing large text. The file may contain any number of words. | |
I have 2 projects. I'm using VC++ 2010 express. The first is a static library which generates a lib file called stdlib.lib. The second is a dll project which links to stdlib.lib. When I try to compile, I get linker errors that say unresolved reference and they refer to functions … | |
OK I'll try to explain what I'm trying to do... I've got 16 numbers in an array and I want to find out the best way of adding any combination of these (it can be 2 of them, 5 of them or all of them) to get as close to … | |
first time using libcurl I'm trying to use it for a function that downloads a page's source code like this getHTML(string URL); but I do not understand the set up [URL="http://curl.haxx.se/libcurl/c/libcurl-tutorial.html"]libcurl[/URL] [QUOTE]There are many different ways to build C programs. This chapter will assume a UNIX-style build process. If you … | |
what is the difference in the 2? [CODE]class Log { private: // no members attributes public: void createLog( ); }; int main() { Log log1; log1.createLog(); }[/CODE] [CODE]class Log { private: // no members public: static void createLog( ); }; int main() { Log::createLog(); }[/CODE] | |
Hi could someone please helping in starting this program? I am not asking anyone to do my work for me i just want to know how i can start the program and steps to follow please( i am new to c++) thanks write a program that reads an n*n matrix … |
The End.