51,593 Topics

Member Avatar for
Member Avatar for monkey_king

Hi, I've been programming a lot of c code, and now I'm trying to set my mind into the c++ way of doing things. so I'm trying to avoid pointers, and use refs instead. As far as I understand pointers are to be avoided using stl's for instance. I have …

Member Avatar for ArkM
0
117
Member Avatar for dmlandrum

I don't know how many C++ coders might be out there, but I've been trying to get this question answered about multiple inheritance. Say I have a class called B that inherits from A: A -> B Now, I create a class called C that, perhaps due to programmer unfamiliarity …

Member Avatar for grumpier
0
93
Member Avatar for inkcoder

Hey everyone, still learning c++ I had a question. How do I create an array that will hold strings of text. such as: ??? map[10]; map[1]= "text"; map[2] = "text2"; map[10] = "text3"; cout<< map[1] "\n"; help would be great ink

Member Avatar for Lerner
0
118
Member Avatar for daggath

Hi, I recently was trying to learn how to write DLLs and was doing ok until I ran across this interesting problem. It seems that the function is not receiving the last argument. Here is my code for the dll [code]#include "stdafx.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID …

Member Avatar for daggath
0
171
Member Avatar for nizbit

I have an input file that has call to function and arguments that are passed to that function. There might be one argument or two. A simple while loop for input will not work ex-while(inputf >> function >> arg1 >> arg2) because if a function has only one argument then …

Member Avatar for nizbit
0
233
Member Avatar for KraMer

Hello everyone! I've started a project on SF.net to create a small yet modern IRC client (µIRChat or simply µIRC). However, there one thing that I really can't decide before I start, and that is the language to use. My idea came from µTorrent, which is, as far as I …

Member Avatar for KraMer
0
200
Member Avatar for vidit_X

[URL="http://www.daniweb.com/forums/post303743-1.html"]Q.Write a program which will print all the pairs of prime numbers whose sum equals the number entered by the user. ( suggested by Aniseed ) (Intermediate) [/URL] [code=C++] #include<iostream.h> #include<conio.h> #include<math.h> int prime(int); void main() { int i,j,c1,c2,num,f1,f2; clrscr(); cout<<"Enter the number-"; cin>>num; for(i=2,j=num-2;i<=num/2;i++,j--) { f1=prime(i); if(f1) { f2=prime(j); …

Member Avatar for vidit_X
0
656
Member Avatar for deepak@

I will explain... I downloaded `mysql-5.0.45-win-src.tar.gz` from Mysql download area.I tried to built Mysql.sln inside that,but i am getting errors(about 58) like Error 149 fatal error LNK1181: cannot open input file '..\zlib\release\zlib.lib' mysql_upgrade Error 319 error PRJ0019: A tool returned an error code from "Performing Custom Build Step" mysqld Error …

Member Avatar for ArkM
0
121
Member Avatar for urbancalli

guys, what do you think is the best compiler for beginners in C++? actually we are asked to make a game in C++. we are now using Dev C++, but we can't find a graphics library in it. thanks.

Member Avatar for ArkM
0
259
Member Avatar for AndrejM.

Hi all. I've done some bit of programming in the past, mostly in python and some C aswell. (I can still remember that "C for dummies book" hehe). I'm trying to get started with some anticheat software, of course I'll start with some easy methods first before trying anything more …

Member Avatar for ArkM
0
175
Member Avatar for gregorynoob

okay, so i gotta make a good enough hash function that should be able to make me a key for out of two integers ( -1000000 <= x, y <= 1000000 ), and should work...well atleast 80% of the time so i could store these in an one-dimensional array... i've …

Member Avatar for gregorynoob
0
95
Member Avatar for balena

I'm just writing a reading for the time a binary file where I stored records of my objects. It seems woorks very well. Now I'm working for random access at position "X": [code] ifstream myFile(fileName,ios::in); myFile.seekg( (X*sizeof( object )) , ios::beg); [/code] Should be ok. Before I start to write …

Member Avatar for Salem
0
139
Member Avatar for BradenMurphy

Hey again. just want to know how to create a query such as an insert query with MS access and C++. this is the code im using to connect to the database and im using Dev C++ [CODE=syntax]#include <windows.h> #include <stdio.h> #include <string.h> #include <odbcinst.h> #include <sql.h> #include <sqlext.h> #include …

0
98
Member Avatar for Bigboy06

my program is suppose to count d number of occurrences of a chars in a file. i just dont know how to store d occurences. this is wat i have done up to now. [code=csharp] #include <iostream> #include <fstream> using namespace std; ifstream fin; void charactercount(int& w, char& s ); …

Member Avatar for dougy83
0
138
Member Avatar for nizbit

The recursive function is only reversing the first and last characters of a string. I've been trying for hours but cant find the error. Any help would be awesome. The code: [CODE] #include <iostream> #include <string> using namespace std; void str_reverse(char str[], int length) { char temp, temp1; int starti=0; …

Member Avatar for nizbit
0
213
Member Avatar for JonathanHXC

Hi, I am a new programmer - I'm taking a course of C++ programming in College. I have a quick question - well, I hope it's quick. After I create a program and try to run the program, the .exe file will pop up and in less than a second …

Member Avatar for vidit_X
0
120
Member Avatar for zaaweel

Hello, i just started with on my new school and we are going to make an application that ask how old you are. If you're 13 to 19year old it should say ''Teenager'' But if you write for example 8, it should say '' little kid ". I started to …

Member Avatar for dmanw100
0
80
Member Avatar for BradenMurphy

Hi i've got a problem. I keep getting this awesome error "[Build Error] [Project1.exe] Error 1" I copied this source code from [url]http://www.daniweb.com/forums/thread56924.html[/url] I just can't seem to get it to work. can someone pls help [CODE]#include <windows.h> #include <stdio.h> #include <string.h> #include <odbcinst.h> #include <sql.h> #include <sqlext.h> #include <sqltypes.h> …

Member Avatar for BradenMurphy
0
332
Member Avatar for freelancelote

Hi, I'm learning C++ at the moment using one of Jesse Liberty's books and got to the pointers day. They ask to code a stray pointer as an exercise and give as a solution the following code: [CODE=syntax] int main() { int *pVar; *pVar = 9; return 0; }[/CODE] Could …

Member Avatar for William Hemsworth
0
244
Member Avatar for YaelGD

Hi all, I'm trying to figure out why TH I get these error unhandled exception at <address No.> in <my project neme>.exe: <address No.>: Privileged instruction and another : unhandled exception at <address No.> in <my project neme>.exe: <address No.> : Access violation writing location <address No.> when I try …

Member Avatar for YaelGD
0
138
Member Avatar for Ayu1004

I've spent entire night and day searching on the internet how to solve my problem, and i couldn't find anything... so please help me, if you know :( this is piece of my code: [code] int main () { string line; cout<<"Welcome!"<<endl; getline(cin, line); while (line!="0") { hello (line); getline(cin, …

Member Avatar for Ayu1004
0
181
Member Avatar for ulrik04

hey all :) I'm making a console program, and I want to do that when you run it from the terminal, you can give arguments like -debug (./program -debug). How do i get whether an argument is set or not in the code? i've tried #ifdef debug, but it didn't …

Member Avatar for ulrik04
0
281
Member Avatar for Ayu1004

well i didn't have to include anything except string with working with strings and getline, and getline works... but there's another problem. i always have to press enter twice for another line of code to read ;_;

Member Avatar for Ayu1004
0
94
Member Avatar for Mehwish Shaikh

Hello and hii fellows.... I want your help right now in making a BST in which we can perform treeSearch....treeMINIMUM....treeMAXIMUM....treeINSERT....treeSUCCESSOR....treePREDECESSOR....treeDELETE....alongwith INORDER....POSTORDER....PREORDER traversal methods.... I have made a program consistiting of all methods excluding treeDELETE.... I'm ordered to make a tree-class....and a structure for node of a tree.... but im confused …

Member Avatar for Nick Evan
0
360
Member Avatar for olsoul_41

Hi there I have a problem creating a slot machine game in turbo c++ because I cant get the value of the randomize number....

Member Avatar for Narue
0
138
Member Avatar for MylesDBaker

Hello everyone. I am new to coding, taking an introductory C++ class at Baylor University. I am trying to get this standard deviation problem worked out, but I just pulled an all-nighter on it thinking it would be simple, but it is not. I have attached the prompt for the …

Member Avatar for MylesDBaker
0
131
Member Avatar for ambarisha.kn

I have the following function. in this function i am not able to push back in vector. I will explain how it works. if same f_pin will comes in the second iteration compared to first iteration of EventNum loop it will get into if Loop and have to push into …

Member Avatar for ArkM
0
212
Member Avatar for ricardonho

I want to develop some plugins for Mozilla Firefox and Internet Explorer. I download de Gecko SDK from mozilla.org, but all mozilla SDK development is by default focused on Visual Studio. And i don´t have Visual Studio. So then i adapted my own version of Gecko for Dev C++ ( …

Member Avatar for ArkM
0
239
Member Avatar for bamabambhole01

Hii, I have output from computation code called cdof and it is double. i want to creat a file either cdof.log or cdof.dat where i can store values of cdof after each iteration or time step. Please suggest me how to create files using iostream. Thanks

Member Avatar for dmanw100
0
120
Member Avatar for Tensokun

i just ended up getting the Virus Alert! icon right next to my time in the task bar, i cant open my c-drive when i try to CTRL+ALT+Delet it says the Systems Admin took that abbility away from me, yet im the admin for my pc, i cant get to …

Member Avatar for Doctor Inferno
0
148
Member Avatar for Tishiablo

Hello, Usually I can find solutions to problems that seem to arise when I'm coding for this game, but I'm stumped on why this is happening.. So I found out how to get the text from the last line of the text box on this game, and I want to …

Member Avatar for VernonDozier
0
208
Member Avatar for tyserman5674

Hi All, I am having problems with reading input from a sequetail file and I can't figure out what is wrong. Can someone please help me out, I don't know if I am even doing it right, very new at this. The code below is how I generated my .txt …

Member Avatar for raul15791
0
161
Member Avatar for Eilya

Hi friends, I want (a C++ code) to hide a process in kernel 2.6, I don't want monitoring even in /proc. please help me. Regards, Eilya

Member Avatar for Eilya
0
127
Member Avatar for syuk

Can somebody tell me whats wrong with this codes? I’d try to write this program but have error. I don’t how to make it correctly. Please help me! -da question- Write a program to process weekly employee time cards for all employees of an organization. Each employee will have three …

Member Avatar for VernonDozier
0
809
Member Avatar for Alex Edwards

I was tinkering around with code in C++ last night trying to make a template algorithm that would be evaluated at compile time and also print information. Unfortunately, because std::cout and std::cin are references to objects and they aren't considered built in types (directly at least), I suppose the compiler …

Member Avatar for Narue
0
3K
Member Avatar for phillipeharris

Well I am sure that my code is right. but in my main ().. my cout <<myTree casues an issue and I dont know why . any help would be much needed... I am almost there.

Member Avatar for phillipeharris
0
126
Member Avatar for dexter1984

I'm almost done with my assignment but now I'm stuck with some binary file problems. Below is the binary file section of my work. [CODE=cpp]cin.ignore(); cout << "\nPlease enter filename: "; cin >> openBinary; ifstream finBinary; finBinary.open(openBinary, ios::in | ios::binary); if (!finBinary.good()) cerr << "File could not be opened" << …

Member Avatar for Narue
0
141
Member Avatar for crioto

Hi everybody! I have some questions related to database servers. I writing in C++ under GNU/Linux, and i need to use database in my app. Small description: My app will use database very hard, so i need faster database. And for now i need real advice. Which database to use? …

Member Avatar for iamthwee
0
58
Member Avatar for dirtdogg

this is the program: [code=cplusplus] #include <iostream> using namespace std; int main() { double f0, speed, f1; f0 = 2e-10; speed = 75; f1 = ((speed + 6.685e8) * f0) / (6.685e8 - speed); cout << "The return frequency corresponding to 75 miles per hour is " << f1 << …

Member Avatar for dexter1984
0
116
Member Avatar for amrith92

hey, This might be naive, but how come this bit of code isn't working??? [CODE] int lc=0; read.open(filename_user.c_str(), ios::in); while(getline(read, linecount, '\n')) { ++lc; }[/CODE] Have looked through the internet, and this code seems to be fine, so what is it that makes it not work?? the output is always …

Member Avatar for amrith92
1
211
Member Avatar for alanchan

I have some questions about using Cavium CSP, which need your kindness help. According to the explain in MSDN, the function 'CryptDestroyKey' of CRYPTAPI will not only destory the key handle, but also free the memory that the key occupied. But using Cavium CSP, the function does not free the …

0
39
Member Avatar for Kadence

I have a class that has functions which use <stdio.h> and <stdarg.h> to take in indefinite arguments, and one of the member functions taking in filenames. There's another function (call it the "do" function) where I want to read from ifstreams created from those indefinite number of filenames. I can …

Member Avatar for Kadence
0
820
Member Avatar for edisonchua

hello everyone, im new to c++. i was able to create a dll using vb.net, created it as COM CLASS. this is for me to be able to create a .tlb file which will be imported to the c++ version 6. my question is how will i import this library …

-1
52
Member Avatar for raul15791

I have this problem. This program runs well except that it skip the value of the first item in list. I think it is because of the cin.ignore(). But if I don't use the cin.ignore(). The cin will only read the first input and none after that. Help? [CODE=cplusplus] #include …

Member Avatar for raul15791
0
118
Member Avatar for Fragmad

I really need help. I'm pretty new to c++. I want to send a simple keystroke to notepad (not really notepad, but I'm using it while I learn). I might have forgotten something, I don't know. I have a feeling it's some retarded mistake... [CODE]#include <windows.h> #define VK_A 0x9E void …

Member Avatar for Fragmad
0
256
Member Avatar for alanliao09

I am currently using the ODBC class for c++ to connect and query a SQL database. I am calling a stored procedure within the database like so: [code=cplusplus] try{ myCon->Open(); OdbcCommand^ myCmd = gcnew OdbcCommand(MySP,myCon); //MySp is my store procedure and myCon is the SQL server connection string myCmd->Parameters->Add("xml",OdbcType::Char,200); myCmd->Parameters->default[0]->Direction=ParameterDirection::ReturnValue; …

0
59
Member Avatar for nanodano

I'm writing a Win32 application for Windows XP with Visual Studio 2005. It is a console program, and I'm trying to find the HWND attribute of my console. I need this because I need to use it as a parameter for a function. So, thanks to the MSDN library I …

Member Avatar for lenhattien
0
539
Member Avatar for TechNovice

Hi, I am currently trying to create a program where I input a file called "exp.txt" that contains two columns: 1) date 2) expenses. There are 100 rows. Essentially I'm trying to read a file containing DATE-EXPENSE pairs and find the average EXPENSE between two specific Dates. Eventually, I will …

Member Avatar for VernonDozier
0
133
Member Avatar for dexter1984

Part of the code from the program I'm having trouble with. The deletion of array element for this doesn't work properly. Can anyone tell me why? I can't spot any mistakes though zzz, [CODE=cpp]cin.ignore(); delStudentCounter = 0; cout << "Please enter ID to delete student: "; cin.getline(delStudent, 50); for (int …

Member Avatar for Salem
0
101
Member Avatar for Jennifer84

There is one detailproblem that always occurs when I read text from a file and then putting this text to a multilined richTextBox. What happens is that the text begins on Row number 2 in the textbox and not on the top(Row 1). It seems that a linecharacter perheps is …

Member Avatar for Jennifer84
0
80

The End.