51,593 Topics

Member Avatar for
Member Avatar for flaviusilaghi

What is the correct way to declare a multidimensional array. I tried like this [CODE]unsigned char** intext=new unsigned char*[16];[/CODE] but i get a bad_ptr.

Member Avatar for flaviusilaghi
0
160
Member Avatar for fernandofranca

Hi, I´m having problem while converting char to string. [code=c] #include "stdafx.h" #include <fstream> #include <cstdio> #include <iostream> int main() { std::ifstream arquivo("entrada.txt"); if (!arquivo) { std::cout << "Arquivo não encontrado" << std::endl<< std::endl; system("PAUSE"); exit(0); } std::string token; char arquivo_linha[255]; while(arquivo) { arquivo.getline(arquivo_linha,255); if (arquivo_linha[0] != 35) { token …

Member Avatar for fernandofranca
0
198
Member Avatar for fernandofranca

I´m using Visual C++ Studio and when I include another .cpp file it doesn´t takes all the what have been included before. Here is an example: main.cpp [code=c] #include <iostream> #include <string> #include <sstream> #include "readtext.cpp" int main() { teste(); return 0; } //readtext.cpp void text() { printf("teste"); } [/code] …

Member Avatar for nbaztec
0
203
Member Avatar for web3

Can anyone tell me what GUI to use? And is there a GUI similar or same like standard library? Thanks in advance.

Member Avatar for Stefano Mtangoo
0
213
Member Avatar for MaestroS

Well, I wonder HOW to make an explode() function from PHP in C++ For those who don't know. explode($separator, $string) breaks given $string through given $separator for example: [code] $string = "Hello world!"; $result = explode(" ", $string); echo $result[0]; //IT will give us HELLO word echo $result[1]; //IT will …

Member Avatar for Stefano Mtangoo
0
888
Member Avatar for avarionist

Im working on a program to get single characters from a string and i guess im doing it wrong but i was using strok() to tokenize the string in the hopes that it would do so but anyway this is what ive got so far and before you ask its …

Member Avatar for NathanOliver
0
376
Member Avatar for highflyer8

Hi, I have to calculate the exponetial of a large (on the order of 10^5) negative number. I tried using exp(), the exponential function from the cmath library, but I get an answer of 0. So, I tried to use the power series for the exponential function. For numbers from …

Member Avatar for arkoenig
0
1K
Member Avatar for JIMITRIS

I please want to ask if anybody knows how to install allegro without use of terminal..

0
75
Member Avatar for aliyami90

Hi everybody . i have a problem that i have been trying to solve for weeks can u help. this is bonus problem given to me by my professor in college. hers is the description: menu driven library: 1. list books 2. add books 3. find books a. by id …

Member Avatar for NathanOliver
0
829
Member Avatar for vbx_wx

i need some help: i have something like: word1:word2:word3:word4 ...read from a file,how can i do,when i read this line,each word delimit by ":" to put into a string.... string str1,str2,str3,str4; str1 = word1; ........... str4 = word4; sorry for my english i hope eu understand

Member Avatar for daviddoria
0
134
Member Avatar for Grusky

Ok, I am about 20+ hours into this utterly confusing idea of link lists. The classes I have are listed below. I cannot for the life of me understand how I would write a reverse function. My office floor is cluttered with printouts and scribbles from trying to make this …

Member Avatar for daviddoria
0
137
Member Avatar for iamcreasy

No programs are running.Both is Visual Studio and Codeblocks... both are showing the following error, [B]LINK : fatal error LNK1104: cannot open file 'kernel32.lib'[/B] I have google it, some say setting environment to "C:\Program Files\Microsoft SDKs\Windows\v5.0" or reinstalling visual studio, or editing registry key "HKEY_CURRENT_USER\SOFTWARE\Microsoft\MicrosoftSDKs\Windows\CurrentInstallFolder"(i didn't find any MicrosoftSDKs under …

Member Avatar for iamcreasy
0
2K
Member Avatar for abhi74k

Why is the constructor called from top to bottom rather than bottom to top ????

Member Avatar for abhi74k
0
149
Member Avatar for abhi74k

I read that the initialisation of the vptr is done by the default constructor automatically . What happens when u provide implementation for the default constructor . Is the initialisation code added automatically ???

Member Avatar for abhi74k
0
53
Member Avatar for dchunt

I have a file over 100 Kb long. I want to perform operations on successive batches of 256 characters. [CODE] int fs=0; char ss[32556]; ifstream nm,nm1; nm1.open("as86.txt"); if(nm1.is_open()) { nm1.seekg(0, ios::end ); fs = nm1.tellg(); } nm1.close(); nm.open("as86.txt"); nm.read(ss,fs+1); nm.close(); cout << endl << fs << endl; ofstream mn; mn.open("as86.txt"); …

Member Avatar for nbaztec
0
106
Member Avatar for SJP99

I know this gets asked a lot but i want to make a program that sends me some form of an alert at a certain time of day. I am using windows 1. i want it too run invisibly so no windows, doesn't show in task bar, or task manger …

Member Avatar for SJP99
0
146
Member Avatar for charlie4oct

hey please can anybody guide me how we can take input from the command prompt as we do in C++ and Java. I can take input using .dat files but I want the user to give input in the command prompt. I will be very thankful.

Member Avatar for nbaztec
0
81
Member Avatar for katmai539

Hello, yesterday, a friend of mine who develops in all kinds of languages but mostly VisualBasic.NET, told me he only listens to the regular kind of pop and rock, and sometimes to heavy metal kind of things. But -he told me- when he had something to do in C-style code …

Member Avatar for Bench
1
251
Member Avatar for Roelof Wobben

Hello, For a exercise I have to make a programm where several student puts thier home-grades in and thier names. here's the code [code] #include <string> #include <vector> #include <iostream> using namespace std ; int main() { vector<string> names ; typedef vector<double>::size_type siz_tp ; siz_tp aantal ; vector<double> numbers; typedef …

Member Avatar for Roelof Wobben
0
99
Member Avatar for Leppie

So close (I think)! I've been working on this for some time now (on and off, coming back to it) and now I'm stuck. Hopefully there's not to much wrong with the coding of it, the compiler throws up lines 50 & 63 with errors? Not to sure if I've …

Member Avatar for Leppie
0
185
Member Avatar for adamomo

Hi I am trying to create a tester to check a server-client application assignment. When I try to run the server in the background I can not properly start clients - one different terminals I do manage. I am looking for a mechansim to automatically create a server and a …

Member Avatar for nbaztec
0
119
Member Avatar for meepokman

Hi guys, I'm currently trying to produce a facial detection application, but I seem to have some problems. My program, is able to recognise multiple users, and match their captured image to one saved in the database. However, if a person who has not registered is photographed, it is supposed …

Member Avatar for meepokman
0
449
Member Avatar for KAY111

[CODE=C] #include <math.h> void greedyMatch() { Xnode *u; Ynode *v; arc *e; forallXNodes(u,G) { assert(!u->isMatched()); forallOutArcs(e,u) { #ifdef STATS stats.searchArcCnt++; #endif v = e->head(); if (!v->isMatched()) { #ifdef STATS stats.mVal++; stats.greedCnt++; stats.flowArcCnt++; #endif v->match(u); u->match(v); break; } } } } void augment(Ynode *last) { Ynode *v, *v1; Xnode *w; arc …

Member Avatar for arkoenig
0
116
Member Avatar for mattloto

I am interested in using DirectX to make games. I'm using MinGW, which is a windows command line port of GCC. How would I get it so that DirectX 10 is included in the files? It probably is in the headers, but I don't know which to include because most …

Member Avatar for Ketsuekiame
0
280
Member Avatar for akssps011

I am new to C++ in terms of large projects distributed over various source files. When I compile(gcc compiler) I get the following error: undefined reference to 'C::C()' I have this code: [B]/src/lib/abstract/[/B]A.cpp [CODE] #include "src/plugins/geo/C.h" #include "B.h" class A:public B { public; A() { B m_b; } void speed() …

Member Avatar for akssps011
0
167
Member Avatar for hisugan

...well i would like to practice c++ by analyzing the logic of the sample programs.... ..thank you for your help.. i really appreciate it...

Member Avatar for Ketsuekiame
0
83
Member Avatar for Schoorsteen

Hey there, I am attempting to open Firefox using C++ on Linux (Ubuntu). However, I get an segmentation fault. What am I doing wrong, and what should I do? [CODE]std::cout << system("/usr/bin/firefox") << std::endl;[/CODE] /usr/bin/firefox works in commandline and when I run this program in debug mode in Netbeans, firefox …

Member Avatar for daviddoria
0
580
Member Avatar for venomxxl

I'm writing a small game engine and I have a little problem. The code below shows the exact situation: Header1.h [CODE] #ifndef _HEADER1 #define _HEADER1 #include "Header2.h" namespace HNamespace { class HClass1 { public: HClass1() { } ~HClass1() { } HClass2 * A; }; } #endif [/CODE] Header2.h [CODE] #ifndef …

Member Avatar for venomxxl
0
101
Member Avatar for ndowens

I am wondering if somebody could recommend a good book and/or tutorial for an absolute beginner with no previous programming experience. Thanks. Also If I can do decent at programming, I may end up going to college in order to try and make programming a possible career

Member Avatar for Bench
0
135
Member Avatar for atman

Hello! I'm new to c++ but I have a problem and desparate for help. I'm trying to store string and integers into a file, but only strings get stored and integers dont. I tried casting,didnt work. Not to convolute you with my code, I came up with this small program …

Member Avatar for StuXYZ
0
116
Member Avatar for jsparger

Hi guys, Shortly my research group will be getting a big fancy set of CAEN VME nuclear instrumentation modules. It will be my job to write some C/C++ programs to control all of these modules. That's about as far as I understand. I'm a C++ baby (I know some Java, …

0
35
Member Avatar for NathanOliver

Hey all I have seen a lot of stuff about palindrome checkers so I thought I would write one that works for STL containers as well as arrays. it accepts a bidirectional iterator to the first element and an bidirectional iterator to 1 after the last element. Included is a …

Member Avatar for NathanOliver
3
330
Member Avatar for Grep

Hi guys, I would like to execute something like this in my program: system("C:\test\perl\a.pl"); But the problem is i need to execute: perl a.pl Can't just execute the a.pl and expect it to run. Any ideas on how i could simply open up the cmd prompt with my program and …

Member Avatar for Grep
0
254
Member Avatar for zoner7

I have a vector class that is defined using a template. VS 2010 is underlining every instance of these templates, claiming that the identifier Scalar is undefined. Peculiarly, these errors only occur in the definition of the class I will list first but not the one that inherits it. Here …

Member Avatar for thelamb
0
105
Member Avatar for Grep

I would like my C program to run my perl script: I have something like this in mind: system("C:\test\perl\a.pl"); But obviously it needs to do perl a.pl. Not just execute the a.pl. Any ideas? Something simple would be appreciated.

Member Avatar for Grep
0
57
Member Avatar for has problems

I am having a Visual C++ Debug Assertion Failure. It is happening after the internet opens and then try to go to website thats not the homepage. here is the info in the message: Program: C:/Program Files/Internet Explorer/IExplore.EXE Files:dbgheap.c Line:1132 Expression:_CrtIsValidHeapPointer(pUserData)

0
41
Member Avatar for ShortYute

I'm new to c++ however, I have been doing C for about a year now so OPP and all its related things are new to me ( classes etc. ), i have the program in C so I'm trying to find a better way to implement it... Thanks in advance …

Member Avatar for ShortYute
0
124
Member Avatar for dansnyderECE

I'm trying to use .open() but I'm having an issue with my arguments to this function. Here's my code: [CODE] vector<string> FDT_filename; ifstream is; is.open (FDT_filename[0], ios::binary );[/CODE] Which results in the following error: [CODE] ../sim_main.cpp:297: error: no matching function for call to ‘std::basic_ofstream<char, std::char_traits<char> >::open(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const …

Member Avatar for dansnyderECE
0
184
Member Avatar for AspiringCoder

How would you take an int and make each diget into a array element? For example: [CODE]int num = 12345; int nums[4]; // how ever you enter numbers into the array // would result in: // nums[0] = 1 // nums[1] = 2 // and so on...[/CODE]

Member Avatar for AspiringCoder
0
188
Member Avatar for dohpaz42

In a nutshell I am trying to write a program that will connect to a database, query several tables for various sets of data that will then be transformed into XML that is stored into a file on the local hard disk. My first thought process to solve this problem …

Member Avatar for dohpaz42
0
208
Member Avatar for stonerain

I am trying to use the CalcOpticalFlowBM function but I don't understand hot it works. I want to find a motion vector for every blocks but I don't understand that the CalcOpticalFlowBM yields velX and velY. I wrote below code . [CODE]/* Create an object that decodes the input video …

Member Avatar for bart.scotty
1
703
Member Avatar for dinesh.isuranga

I have a Report Model List Controller and I want to get Selected Row Of data to be used.. my Row has there are four data colums.. Name.Age,Birth and Salary... please help me to solve this... thanks...

Member Avatar for CrazyDieter
0
83
Member Avatar for eshabajaj
Member Avatar for zainabalkhalili

i need help converting this C++ to pseudocode help me pleasee [CODE]#include <iostream> using namespace std; { string Z[]={"zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"; string A[]={"zero","ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"; int N,N1,N2,N3, r; string text; N1=N/100; r=(N-(N1*100)); if (r<20){ cout<< Z[N1]+"hundred and"+A[r]; } else{ N2=(N-N1*100)/10; N2=r/10; N3(r-(N2*10)); cout<<[N1]+"hundred and"+A[N2]+[N3]; } cin>>N; return 0; }[/CODE]

Member Avatar for markzain
-2
86
Member Avatar for kudalwarang
Member Avatar for dansnyderECE

I think this is an easy question but I don't know the answer to it. How does one link the value of an argument to a function and the functions parameters? For instance: [CODE]int a; int b; void fn(int &c, int &d) { c++; d++; } int main() { fn(a,b); …

Member Avatar for aman rathi
0
181
Member Avatar for Alex314

Hello, This is probably trivial, but I can't find a solution to the following problem. In C++Builder 2007 I was able to write different strings both to the Application's Title and to the Main Form's Caption. In the Title I displayed the name of the Application; in the Caption (showing …

Member Avatar for Alex314
0
153
Member Avatar for dchunt

Say i have a 256 byte file. How many additions or multiplications can a modern computer perform on them using c++ ? I've been working on this c++ compression project that does a lot of calculations. I use Dev-cpp,and am a amateur programmer,i've not used pointers,vectors or anything fancy yet,anyway …

Member Avatar for thelamb
0
1K
Member Avatar for mksakeesh

Please check the below code template<class T> class Row { public: Row(int cols=0):row(NULL) {SetRowSize(cols);} ~Row() {SetRowSize(0); } Row(const Row &r):row(NULL) { SetRowSize(r.numCols); for (int i=0;i<numCols;i++) row[i]=r.row[i]; } void SetRowSize(int n) { if(row) delete[] row; if (n>0) { row=new T[n]; memset(row,0,sizeof(T)*n/sizeof(char)); } else row=NULL; numCols=n; } int size() { return numCols;} …

Member Avatar for thelamb
0
121
Member Avatar for dualdigger

How can I manage to lock or unlock access db query table. e.g. I have a game which displays few questions and then answers which are taken fromt the access db records. What I want is during the game play, it should remain lock till it is accesed, so that …

Member Avatar for nehasidana
0
198

The End.