49,757 Topics

Member Avatar for
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
121
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
137
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
57
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
109
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
208
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
38
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
809
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
50
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
112
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
252
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
516
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
128
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
99
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
76
Member Avatar for welles

Dear all, I am trying to print out some outputs defined by my own in different function calls and classes into a debug file, I saw in one source code using macros like: #ifdef DEBUG_OUTPUT #define debug2 printf #else #define debug2(arg1,...) #endif and with a call to this macro like: …

Member Avatar for Salem
0
190
Member Avatar for Duki

Which is better? We're designing a new autonomous robot for the competition we attend during the summer and this is one of our topics for design. I want to do a dual-processor, multi-core computer to run the software. Some others want to do distributed computing (between two laptops). Am I …

Member Avatar for Salem
0
273
Member Avatar for Kob0724

I've been trying to compile a program I wrote with QT on a Mac for about a week now and I can't get it to work for the life of me. I'm very confused because the code compiles just fine on a linux machine using a core 2 duo, and …

Member Avatar for kmote
0
248
Member Avatar for mhil_joy

guys i need your help now, tomorrow will be our submitting our program but i have some problem about my program which is the infix to postfix then getting the answer.. I have already the infix to postfix then i don't know how to get the answer, this program is …

Member Avatar for Nick Evan
-1
107
Member Avatar for chern4ever

i m starting to learn c++. i m trying to do a console app. this is my code but i encountered a problem with it after i key in num1 and num2 the total will be display for about a few mili seconds and the console terminate itself. if i …

Member Avatar for Nick Evan
0
90
Member Avatar for tyserman5674

I have been trying to follow what you guys where doing here because I have to do something simalar. Can you tell me what the name of your file is jaffo, is it a .dat or a .txt file? You where using ary, is that the file name? Acient Dragon, …

Member Avatar for Ancient Dragon
0
96
Member Avatar for Ub3r Crippl3

Hi, I'm using a program called FunEditor which compiles in C++. I doubt many people have heard of this program, but if you have, I would appreciate the help. I'm working on creating a Mario-style platformer game, and am trying to make a function where if the Player collides with …

Member Avatar for Ancient Dragon
0
105
Member Avatar for chenzhp

Why static data member 'int' could initialize in class body? but 'double' can't? eg: [code=cplusplus] class Example { public: static double rate = 6.5; //wrong... static int versize = 20; //right } double Example::rate = 6.5; //yes [/code] What reason by design that syntax ?

Member Avatar for chenzhp
0
205
Member Avatar for alajessie

I am working on an assignment for my Data Structures and Algotithms in C++ class. My program will take a user input string and determine if it is a palindrome. I have to use stacks in this program. My program compiles with no errors but the following warning is displayed: …

Member Avatar for Salem
0
5K
Member Avatar for Frederick2

I am trying to understand COM memory layout and using C++ classes just confuses me. In general I understand what is going on with the double indirection of function pointers but as so often is the case in programming one must understand the ugly details – not just the generalities. …

Member Avatar for Frederick2
0
827
Member Avatar for dmanw100

Is there a reliable, cross-platform way to pause a program for a set amount of time? The getch() function will wait for user input, but I would like to be able to pause for say 3 seconds. If a for loop is used like so: [CODE]#include <iostream> using namespace std; …

Member Avatar for Ancient Dragon
0
126
Member Avatar for namedrisk

Hi, i've been trying to find out how do i make a full screen using VSC++. What i have done so far is setting it to auto resize to full screen, removed the status bar, the "close max and min button on the top right corner", the icon and system …

Member Avatar for Ancient Dragon
0
73
Member Avatar for iamloco

by using functions, write a CPP program that calculates a water bill for a user. In order to compute the water bill, user needs to input the unpaid balance, the current and previous meter reading. RM1.10 will be charged for every thousand gallons. A surcharge of 2% is added to …

Member Avatar for iamloco
0
82
Member Avatar for tootypegs

Hi, im having a bit of trouble when it comes to outputing a path to a folder and not a file. Firstly Im using borland c++ builder 6 and it does come with an open and save dialog feature. My problem is it wont let me path to a folder …

Member Avatar for Ancient Dragon
0
91

The End.