49,761 Topics

Member Avatar for
Member Avatar for Zay

hello; can we say this when defining an enumeration : enum letter{A=4,B=3,C,D,E}; i mean give letter B value smaller than the value of the letter A , is it possible ? and what is the real benifet of the enumeartion in general ? sometimes when making "cout" statement , the …

Member Avatar for Zay
0
125
Member Avatar for veronica_0501

hi all.. ive got a C++ assignment to do. this is what it says: Write a program in C++ that takes input from a text file specified by the user and outputs the following to the screen: • Number of single letter words. • The average word length for the …

Member Avatar for tux4life
0
246
Member Avatar for Nikhar

[code] #include<iostream.h> #include<conio.h> class suitcase { int sno[20]; long double amount[20]; public: suitcase(); void print() { int i; for(i=0;i<=19;i++) cout<<amount[i]<<'\n'; } }; suitcase::suitcase() { amount[20]={0.25,1.0,10.0,100.0,250.0,500.0,1000.0,5000.0,10000.0,50000.0, 100000.0,200000.0,300000.0,400000.0,500000.0,1000000.0, 2500000.0,5000000.0,7500000.0,10000000.0}; } void main() { suitcase s1; s1.print(); } [/code] When I run this program, I get an error :- [quote]expression syntax in function …

Member Avatar for Nikhar
0
102
Member Avatar for freshmem

hi everyone.. anybody can give me feistel chipher source code? i,m in urgent plizz..

Member Avatar for freshmem
0
325
Member Avatar for TheSwagger

Working on a project and stumbled here for help. I am at about 90% of what I need but I am having one small problem. With the exception of one of my "if" sections, my "else" output is triggered and diplayed when I don't want it to be. Just asking …

Member Avatar for Ancient Dragon
0
112
Member Avatar for tazboy

I need to read numbers from a user and then copy them to an array. This shouldn't be that hard but I think I'm making it hard by trying to use [I]getline[/I] and then parsing the numbers. Heck I don't even know how to do that. Is there an easy …

Member Avatar for Ancient Dragon
0
87
Member Avatar for RoninMastaFX

Hey there! About a week ago, I started working with C++, just as a hobby. I started working on a Square Root Calculator, just to use it as a reference for my future C++ projects. :) However, when some of my friends were wondering that I could implement 'Pi' within …

Member Avatar for jephthah
0
133
Member Avatar for kangarooblood

Have created a simple bingo game, I'm going to add color later (why I have used the SetConsoleTextAttribute). The problem is that the X i replaced by 88, I know why (I think), it's becuse it's a int and not a char, but when i tried to put in (char) …

Member Avatar for wildgoose
0
2K
Member Avatar for krishnampkkm

Hiii..... when my program running this message comes.. Windows has triggered a break-point in mypgm.exe This may be due to a corruption of the heap, and indicates a bug in mypgm.exe or any of the DLLs it has loaded Actually in my operation I was copying files... Memory is deleting …

Member Avatar for Salem
0
247
Member Avatar for johnray31

Hi guys, i am quite newbie to c++. Is there any way to know object class. I have a object and i want to know the exact class name for that.

Member Avatar for tux4life
0
122
Member Avatar for walter clark

The .h file traditionally holds declarations and the .cpp file the definitions. The #include inserts the human readable ASCII code that is the .h file, right there at the top before compiling. The main purpose of the .h file was to gather together all the declarations (more even than you …

Member Avatar for walter clark
0
120
Member Avatar for kangarooblood

does anyone of you lot know a way to use colors in a program compiled in Dev C++, except for the [code=c++] system("color a"); [/code] function? and I'd also be glad to know another way to clear the screen, then the: [code=c++] system("cls"); [/code] function

Member Avatar for Tom Gunn
0
111
Member Avatar for razor1234

i have to get an integer out of the unsigned char string and assign it to unsigned int varable.... i mean if i have unsigned char array = { "123"}; i simply want to get either 1 or 2 or 3 out of it and assign it to unsigned int …

Member Avatar for Ancient Dragon
0
218
Member Avatar for goody11

My friend and I are trying to write a program for my Spanish teacher so that she can just type Spanish words and English words into an application, those words get stored as an array somewhere, and then another program that tests the kids uses that array. The program gives …

Member Avatar for s_sridhar
0
114
Member Avatar for Nikhar

I'll try to get this as simple as possible. The problem is fairly simple. [code] long double a=100000000; cout<<a; [/code] Well, the output this shows is "1e+08" I do not want the output to be in exponential form. Rather, I want it to be printed as "100000000". What shall I …

Member Avatar for s_sridhar
0
105
Member Avatar for ankur shah

Hi every body I want to know how i can read a very large binary file in to a character array using c++. I can read the whole file by using fread function but when i go no searching anything in that character array. i cant search. i have used …

Member Avatar for tux4life
0
126
Member Avatar for lotrsimp12345

[code] #include <iostream> #include <cstdlib> using namespace std; int main() { cout <<"enter the problemset and number""\n"; //problems represents name and numbers string problems , probtitle; string xx; bool x=true; char quote; string str1, str2; string begin; //gather name if(cin.peek()=='"' || cin.peek() == ''') { cin >>quote; getline(cin,problems,quote); } else …

Member Avatar for WaltP
0
240
Member Avatar for XxGunMastaxX

Hello, I have a question to ask whoever can help me. I've have dev - c++. see I've been using C++ for a while now but i'm still sorta a newbie... i havn't had this problem before but i've been trying to do a password program just to play around …

Member Avatar for WaltP
0
150
Member Avatar for krishnampkkm

hiii In my program I'm reading the clusters in the volume using the appropriate physical offsets to the disk. [CODE]for( i=0; i< total_number_ of_ clusters;i++) { // convert logical offset to physical offset phys_offset= conversion(i); // this value I get correctly if(!SetFilePointer(drive_handle, phys_offset, NULL, 0)) { printf("\nSetFilePointer Failed: Error Number …

Member Avatar for krishnampkkm
-1
388
Member Avatar for valinux

HI EVERYONE :D!! This is my first thread. Well today was my birthday! And I got my first computer! I have always wanted one and I have always wanted to start programming! I got a Microsoft Windows XP and a extra external hard drive!! Not the best computer ever but …

Member Avatar for csurfer
0
155
Member Avatar for jimtaylor

I have 2 Dell 1420's, both running under Vista Home Premium. One is a few months older than the other. I am running Borland C++ Builder Personal Version 6.0 on both of them. The older computer runs the c++ compiler flawlessly. On the newer computer, however, the debugger isn't working …

Member Avatar for Yiuca
0
149
Member Avatar for dzhugashvili

Hey, I was wondering if anybody had code to implement mscache. Writing an mscache password recovery tool. I know how to use OpenSSL to turn a plaintext into an NTLM hash, but I don't know how to do it from there. Anybody have any idea how to convert the username …

0
58
Member Avatar for eliza2044

Hey guys, I have a problem printing out the contents of a list of objects, with the following code I loop through the list and call the displayInfo() method that it's responsible for printing out the different attributes of the object. I have tested the displayInfo() method and works fine, …

Member Avatar for tux4life
0
145
Member Avatar for NervousWreck

I recently installed Ubunty Jaunty (Linux). I checked out the Linux version of the Codeblocks IDE. Obviously things like [code] system ( "pause" ); [/code] didn't work because of the operating system. Is there a library I can include -- or a package I can install -- that will give …

Member Avatar for NervousWreck
0
130
Member Avatar for Nikhar

Well, I posted a few problems here on daniweb and thank god that I did so. What I had been using till now was "rusted, naff,useless" code. But after today, I am more accustomed to what the new c++ is. Well, I am 16 years old and am studying in …

Member Avatar for siddhant3s
0
330
Member Avatar for lotrsimp12345

if it contains quote it cuts it out, then i am stuck on part when i just enter in a problemset without a quote or single quote. Then it doesn't gather numbers correctly but stores the entire string [code] int main() { cout <<"enter the problemset and number""\n"; //problems represents …

Member Avatar for Salem
0
108
Member Avatar for fadia

Hello.. can someone teach me how to do this program. This is the question. 1. An organization has aprox. $1000 available to be allocated in small amount to approved charities. Write a program that will read several amounts and ((report as soon as over $1000 has been allocated. << NOW …

Member Avatar for tux4life
0
163
Member Avatar for lotrsimp12345

[code] #include <iostream> using namespace std; #include "Interface.h" #include <conio.h> int main() { apple t; bool quit = false; while(! quit) { cout<<"the original value at beginning of clock is\n"<<clock()<<"\n"; t.start(); cout<<"hit enter when you want to stop timer\n"; if(cin.get()=='\n') { t.end(); int time =t.elapsed(); cout<<"the time difference is\n"<<time<<"\n"; cout<<"enter …

Member Avatar for lotrsimp12345
0
106
Member Avatar for Nikhar

Hi everyone. Can anyone please guide me on how can I generate a random number from a group of prset numbers. For example:- There is a group of preset numbers:- 1,5,18,100,127,500,626,929. I want to generate a random number from this group....is there anyway in which we could do this?

Member Avatar for Nikhar
0
347
Member Avatar for waldchr

I am writing a portable desktop for my flash drive as an alternative to the portable "menus" that you can download. I need to know how to drag a link from somewhere on the screen (eg desktop, start menu or windows explorer) and drop it in my program. It also …

Member Avatar for waldchr
0
134

The End.