51,593 Topics

Member Avatar for
Member Avatar for stupidenator

Hi everyone, I am trying to write a program for a class but I cannot seem to figure out how I can convert a date in the format mm/dd/yyyy to separate int values. I.E. m+m+d+d+y+y+y+y. I've got the rest of the program written, but I cannot seem to figure this …

Member Avatar for stupidenator
0
223
Member Avatar for server_crash

I'm trying to create a Mammal class which has two virtual methods, and one non virtual methods to demonstrate inheritance. I've written the class, but now I have a few errors, and a few questions. First of all, I'm recieving an error that says the following methods aren't declared: speak(); …

Member Avatar for CrazyDieter
0
135
Member Avatar for SpS

Can we find the smallest of three integers, without using any of the comparison operators....logic please

Member Avatar for SpS
0
320
Member Avatar for SpS

[QUOTE=narue]Well, you didn't specify how it didn't work, but on one of my compilers, there's a run-time assertion if the allocation size exceeds a certain limit, and 4294967295 is beyond that limit. Such an assertion throws up a dialog box and aborts the program, which could look like an uncaught …

Member Avatar for SpS
0
127
Member Avatar for heavyc

I was wondering if anyone can help me with linked lists??? I have to create a linked list with 10 random numbers rangeing from 1-5 and insert them into a node in the appriote postion of a linearly linked list and display the number of times each number of occurences …

Member Avatar for Narue
0
317
Member Avatar for SpS

as new throws exception bad_alloc...does malloc also throws exception of some kind???

Member Avatar for Narue
0
560
Member Avatar for smagee12

Hello, i am just starting to learn c++. Ane hints or tips would be appreciated. I have a text file that looks something like this 2 fred hind 6 julie frie Now, i need to take that number, set it to an element of the array, then store the name …

Member Avatar for smagee12
0
170
Member Avatar for bumsfeld
Member Avatar for Ancient Dragon
0
236
Member Avatar for bumsfeld

I need to write about a half one page instruction string for one of my C++ programs. How do I do this best, so I can read it in the code and easly update it later. I have tried concatinating, but that makes corrections tough on the wrapping edge.

Member Avatar for Narue
0
322
Member Avatar for SpS
Member Avatar for Ancient Dragon
0
96
Member Avatar for Sam Lehman

I'm making a program which sends a specified line of text to the active window when you press a specified hotkey. I've figured out how the hotkey part, but have no idea on how to send the text to the active window. does anyone give me some ideas on this? …

Member Avatar for BountyX
0
251
Member Avatar for BountyX
Member Avatar for BountyX
0
156
Member Avatar for ashwinperti

Sir, I want to know why is it so that, in the Case of C Language there is no need to include stdio.h Header file. But when the same Program is saved with with .cpp extension it ask for the prototype. and we have to include the stdio.h header file. …

Member Avatar for Narue
0
116
Member Avatar for Niklas

Ive searched through google and most are not free, and the ones that are are being declared have a virus inside by norton as well as ewido. BTW im trying to do this because there was a PSP (playstation protable bin loader released) [URL=http://www.psp-hacks.com]website and article here[/URL]. I wanted to …

Member Avatar for Niklas
0
229
Member Avatar for needCee

Hi, :?: any one please can tell me what iam doing worng ? what iam trying to do is that to make program to create small database with following option add, delete , show ,edit search but i need to have them in it´s own source code so. what iam …

Member Avatar for needCee
0
130
Member Avatar for SpS

Plz look at this code [code]#include<iostream.h> int x=0; int main() { int x=1; { int x=2; cout<<::x; cout<<x; } return 0; }[/code]<< moderator edit: added [url=http://www.daniweb.com/techtalkforums/misc.php?do=bbcode#code][co[u][/u]de][/co[u][/u]de][/url] tags >> does anybody know how can i access main local variable x, from inside the block, without using pointers or references?

Member Avatar for Narue
0
216
Member Avatar for Niklas

Okay Ive made a bunch of single use calculator programs (one for addition, subtraction, mutiplication, and division). Addition Code [CODE]#include <iostream> using namespace std; int main() { cout << "Please enter 2 numbers to be added "; int a; int b; cin >> a; cout << "\n num1: " << …

Member Avatar for Narue
0
368
Member Avatar for pit_bull

People i am in trouble :sad: whenever i run any c++ program which i have written, the computer shows this error: :mad: General Protection Exception 0x3DCF:0x1E0B program(1) 0x3DCF:0x1E0B Processor Fault I use Turbo C++ 4.5 (i am only a 16-year old school student) this is one of my codes (all …

Member Avatar for Narue
0
267
Member Avatar for aminura

[CODE]#include<iostream.h> int main() { enum flag{ x=1,y=2,z=4,e=8}; flag f2=flag(99); // out of range return 0; }[/CODE] In this code the range of flag is 0:15 but it still compiles when 99 is entered which is out of range!!

Member Avatar for aminura
0
374
Member Avatar for djbsabkcb

My program is suppose to read in numbers and tokens. However, it will only read in the first number and go into a loop. Never reads the next number or does the computations. Can't figure out what's wrong. [code] #include <iostream> #include <string> #include <iomanip> #include <fstream> #include <cmath> #include …

Member Avatar for djbsabkcb
0
136
Member Avatar for martinr

Hi i'm a C++ Noob, i'm trying to write a c++ function to listen for snmp traffic and send back some variables to the source. i'm not 100% sure of what i'm doing :o i'm including Wsnmp.h and also linking to Wsnmp32.lib from within visual c++ however it doesn't recognise …

Member Avatar for CrazyScntst
0
489
Member Avatar for Alan Lewis

Dear all, I'm developing an SNMP manager using WinSNMP API. While starting up the SNMP by calling the function SnmpStartup, it returns SNMPAPI_SUCCESS, but strangely the 5 output parameters are not defined after the function is executed. Is this normal? Why is this happenning? What should I do? Regards, Alan …

Member Avatar for CrazyScntst
0
824
Member Avatar for hunanrostomyan

Hi everyone, I have got this code` [code]//---------------------------------------------------- #include <cstdlib> #include <iostream> #include <fstream> using namespace std; int main(int argc, char *argv[]) { start: ofstream examplefile ("example.txt"); examplefile<<""; const int SIZE = 100; char msg[SIZE]; cin.getline(msg,SIZE); examplefile << msg; examplefile.close(); cin.get(); system("cls"); goto start; return 0; } //--------------------------------------------------------[/code] And when …

Member Avatar for Narue
0
167
Member Avatar for djbsabkcb

I keep getting this error message and the code below: I can't figure out why any help would be appreciated. Line 51 is this statement in my code: Element* Stack::Element::Prev(void) error message: [code] In file included from Stack03.cpp:28: Stack03.h:81:7: warning: no newline at end of file Stack03.cpp:51: syntax error before …

Member Avatar for Narue
0
147
Member Avatar for mina1984

hey, um i was wondering if anyone could help me with a program where if the user inputs a number no more than 5 digits and the program tells you how many times the number 2 appears in that number. i know that the modulus and division have to be …

Member Avatar for mina1984
0
230
Member Avatar for aminura

I have a doubt regarding constructor in this program-- [CODE]include<iostream.h> class A { private: int a; float b; A(int j) { a=j; cout<<"\n a is"<<a; } public: A() { cout<<"\n Default constructor invoked\n"; a++; b=0; } A(int j,float i) { a=j; b=i; cout<<"\n value"<<a<<"and"<<b<<endl; } public: void show() { int …

Member Avatar for Narue
0
400
Member Avatar for Niklas

I found this site [url]http://www.crushcalculator.com/cc.cgiid=1127355732zjg[/url] it was a prank going around that made you enter the e-mail adress your name and 3 people you liked. It then sent you an e-mai ltelling you the people that that person liked. I know I could just the one already made but I …

Member Avatar for Narue
0
117
Member Avatar for coolgirl

Hello Can some one please explain what this statement is I am very new to C++ and VC++ statement sprintf(DirString,"%s/cl_log.csv",DirName); I could not understand what second argument Thanks in advance, Durga

Member Avatar for winbatch
0
177
Member Avatar for ashwinperti

Sir, I want to multiply a 2-D array of size 100 by 100 a[100] * b[100]; or a[100][100]; What is the way to multiply the two arrays. Ashwin Perti

Member Avatar for Rashakil Fol
0
246
Member Avatar for Niklas

:mrgreen: I've just started learning and doing examples out of the book but I wanted to see if I could actually make something besides just copying stuff out of a book. So I tried to make an addition calculator. This isnt the entire source code but just a few snippets …

Member Avatar for Niklas
0
258
Member Avatar for Acidburn

Can anyone help us out in this dept, everytime I go through my program when it terminates I get the famous windows: "main.exe has encountered a problem and needs to close. We are sorry for the inconvencience ........ Debug, Send Error Report, Don't Send Yep that one... Can anyone offer …

Member Avatar for Acidburn
0
257
Member Avatar for Shun

This is begining to bug me. I have googled it. I have searched this site and I still have not managed to get the rounding to work the way I want! I have done the Math::Round() deal, I have tried System::Math::Round. I got desperate and looked to see what it …

0
107
Member Avatar for server_crash

What's the point of a struct? I mean, isn't it basically the same thing as a class? So what it's used for?

Member Avatar for server_crash
0
164
Member Avatar for rufusOT

heya folks. i'm working on an chunk of code here and i don't really understand what i am doing wrong in trying to increment and decrement a fraction. if you could provide some insight i would appreciate it. thanks. [CODE]#include <iostream.h> #include "fraction.h" void main( ) { Positive_Fraction a,b,c; int …

Member Avatar for prog-bman
0
397
Member Avatar for mina1984

hi , i had a problem with one of my programs im pretty sure everything is correct but when i run it it only asks me to input the last name but it would just print out the rest and not ask for any other input why is that? can …

Member Avatar for mina1984
0
128
Member Avatar for bops

hi guys and girls if any :P, im trying to find out how to determine the root directory of a computer, in c++ as part of a larger program im working on, im sure i heard before that there is some api call that can be used to do this, …

Member Avatar for bops
0
149
Member Avatar for Acidburn

[php] hangman::hangman( char * surname, int size) { name = new char[size]; encryption = new char[size]; strcpy(name,surname); for (int i = 0 ;i <size; i++) { encryption[i]='*'; } lives = 5; found = 0; } [/php] encryption seems to be heading over its borders!! the size = 45 ; I've …

Member Avatar for Acidburn
0
161
Member Avatar for Decoder

How do you time execution time?. I am writing a program in C++ to calculate Pi with a desired degree of precision/digits after the decimal point, and I have to calculate the time it takes to calculate for each desired precision. Can anyone help me? :o

Member Avatar for Drowzee
0
143
Member Avatar for Acidburn

[php] #include <iostream> #include <fstream> #include <cstring> using namespace std; #include "NEW.H" int main() { return 0; } [/php] and the *.cpp file: [php] #include <iostream> #include <fstream> #include <cstring> using namespace std; #include "NEW.H" void hangman::LooseLife() { cout << "testing"<<endl; } [/php] and now the header file.... [php] #ifndef …

Member Avatar for Drowzee
0
84
Member Avatar for stinus

Hi all, I have a problem that is hopefully easy to solve for you guys: I have written a rather large C++ program as part of my Master's. Now, I have to use an open source C-library ([url]http://www.tbi.univie.ac.at/~ivo/RNA/RNAlib_toc.html[/url]). I have never tried to combine C and C++. To figure out …

Member Avatar for stinus
0
500
Member Avatar for Acidburn

[php] int j; for ( j= 0 ;j <sizeOfArray ; j++) { if( letter == array2[j] ) { ++found ; encryption[j] = array2[j]; } } if ( array2[j] =='\0' && found!=0) { cout << "not found" <<endl; --looselife; cout << "You now have" << looselife << "remianing" <<endl; } [/php] …

Member Avatar for Narue
0
112
Member Avatar for Drowzee

Hello, all. Rather urgent question. I'm trying to implement a simple Cstring/Cstring map in my application so users can specify what they want to see instead of the MAC address. The information on [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcstdlib/html/vclrfmapvaluetype.asp [/url], however, tells me I can use ::mapped_type. But that doesn't exist as an option in …

Member Avatar for Drowzee
0
476
Member Avatar for djbsabkcb

What am I doing wrong I am not getting these values from the input file to even display correctly or sort in order. Give me some direction? [code] #include <iostream> #include <string> #include <cmath> #include <iomanip> #include <fstream> #include <cmath> #include <vector> using namespace std; class CommandLineException { public: CommandLineException(int …

Member Avatar for djbsabkcb
0
149
Member Avatar for WVTrammell

Where can I find specific instructions? Currently using MAC x10.3.6 operating system. Thanks Warren

Member Avatar for Ancient Dragon
0
89
Member Avatar for Coach_Nate
Member Avatar for SpS
0
115
Member Avatar for Ene Uran

Couldn't sleep last night, so I was browsing and found the "Starting Python" thingy. I must say Python looks interesting from the examples. I learned C++ in school, Python sure looks easier to understand. Does any one think it's better than C++?

Member Avatar for vegaseat
0
178
Member Avatar for SpS
Member Avatar for CrazyDieter
0
121
Member Avatar for sifuedition

Why are my exceptions not working? here is the teststack.cpp #include <iostream> #include <iomanip> #include "teststack.h" using namespace std; struct StackFullException { StackFullException(); }; StackFullException::StackFullException() { cout << "The stack is full."; } struct StackEmptyException { StackEmptyException(); }; StackEmptyException::StackEmptyException() { cout << "The stack is empty."; } Here is the …

Member Avatar for CrazyDieter
0
166
Member Avatar for Tanfo

Hi i'm trying to use libtiff to work with TIFF files but i was unable to build the library and link it with my project in Dev-C++. can someone give me some tips? thanks a lot

Member Avatar for CrazyDieter
0
108
Member Avatar for stupidenator

Hi everyone, I am just starting to learn to program in c++. I am a little confused on where to start though. Is there anywhere I can download an editor and compiler? Thank you. Nick

Member Avatar for stupidenator
0
193

The End.