49,761 Topics

Member Avatar for
Member Avatar for ChaseRLewis

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. …

Member Avatar for ChaseRLewis
-1
113
Member Avatar for stereomatching

[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 …

Member Avatar for vijayan121
0
871
Member Avatar for maybnxtseasn

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 …

Member Avatar for Ancient Dragon
0
94
Member Avatar for wildplace

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 ‘;’ …

Member Avatar for wildplace
0
109
Member Avatar for dumb.king12

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..

Member Avatar for Ancient Dragon
-1
78
Member Avatar for thisischris

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...

Member Avatar for mike_2000_17
0
175
Member Avatar for Gernicha

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

Member Avatar for mrnutty
0
36
Member Avatar for fiberoptik147

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. …

Member Avatar for sergent
0
206
Member Avatar for CodyOebel

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?

Member Avatar for triumphost
0
115
Member Avatar for Rawrels

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 …

Member Avatar for WhiZTiM
0
176
Member Avatar for lotsofsloths

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 …

Member Avatar for ichigo_cool
-1
1K
Member Avatar for IamAuser

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 …

Member Avatar for IamAuser
0
269
Member Avatar for Labdabeta

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(&timestart); …

Member Avatar for WaltP
0
133
Member Avatar for amna masood

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 …

Member Avatar for amna masood
0
100
Member Avatar for goocreations

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 …

Member Avatar for mike_2000_17
0
120
Member Avatar for helpplease234

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 …

Member Avatar for Fbody
0
299
Member Avatar for MagnetoM

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 …

Member Avatar for MagnetoM
0
98
Member Avatar for pdwivedi

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 …

Member Avatar for mike_2000_17
0
603
Member Avatar for kumarmpk4u

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 …

Member Avatar for Ancient Dragon
0
125
Member Avatar for pmark019

[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. …

Member Avatar for pmark019
0
1K
Member Avatar for yozzie

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 …

Member Avatar for yozzie
0
2K
Member Avatar for JJmaster08

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(); …

Member Avatar for jonsca
0
124
Member Avatar for littleleaf

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 …

0
71
Member Avatar for Shaabangbang

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 …

Member Avatar for thekashyap
0
129
Member Avatar for karan_kanna

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.

Member Avatar for csurfer
0
106
Member Avatar for tomtetlaw

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 …

Member Avatar for mitrmkar
0
168
Member Avatar for tometherton

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 …

Member Avatar for tometherton
0
106
Member Avatar for bigwhiteegg

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 …

Member Avatar for vijayan121
0
243
Member Avatar for lochnessmonster

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]

Member Avatar for thekashyap
0
107
Member Avatar for hawita

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 …

Member Avatar for dkalita
0
128

The End.