49,757 Topics

Member Avatar for
Member Avatar for s.j.macleod

{ srand((unsigned)time(0)); int random_integer; int lowest=-10, highest=10; int range=(highest-lowest)+1; for(int index=0; index<8; index++){ random_integer = lowest+int(range*rand()/(RAND_MAX + 1.0)); cout << random_integer << endl; } Hi there, I'm just getting back into c++ after a 2 year break. I'm just wondering how I go about using the numbers generated here later …

Member Avatar for WaltP
0
87
Member Avatar for jeffferson

exaple: /*i have to input the process no.*/ enter a no. of process:(5) p1:10-4=6-4=2 p2:12-4=8-4=4 p3:5-4=1 p4:8-4=4-4=0 p5:12-4=8-4=4-4=0 /*have to input time slice*/ time slice: (4) /*create a box*/ p1 p2 p3 p4 p5 (0) (4) (8) (12) (16) (20) p1 p2 p3 p4 p5 (20) (24) (28) (29) (33) …

Member Avatar for WaltP
0
197
Member Avatar for Valadair

Title should read "search a string for ',' " Afternoon folks. I visit this site a bit, especially when searching google for help on a particular problem. This is my first post, so let me get right to the point. I won't go into the gory details of the program, …

Member Avatar for Valadair
0
107
Member Avatar for spankyg

Can anyone help me with this code? Most of it was written by me for homework. The switch portion was written by my instructor, and it is just pain confusing to me! I beleive I can write a TTT program from scratch (Won't be accepted) easier than cobbling this together. …

Member Avatar for John A
0
142
Member Avatar for sakura_fujin

need help! what's wrong with my code? it compiles but outputs nothing. it requires the user to create a "word.txt" text file for it to start counting the frequency of occurrence of words. i'm a newbie here in daniweb and a novice in C++ programming. i really appreciate any help. …

Member Avatar for Lerner
0
214
Member Avatar for Tales

[I]I need to do something like Play MIDI voice (in the C++ code Snippets page 5), actually, that's exactly what I need, but I would like to make it work in Visual C++ 2005... can someone help me with the configuration steps to make the project work? TYVM [/I]

Member Avatar for Tales
0
156
Member Avatar for ghadahelal

hiiiiiii all, i've an application programm , its data is . cap files i need 2 make a programm with c++ , this programm has 2 read from the .cap data is that possible or not *****. cap file

Member Avatar for Lazaro Claiborn
0
104
Member Avatar for SHWOO

IF I have seven objects of playerType player, player1, player2, player3...etc and I want to search to see if there is a certain player in these objects, how would I do that. I know my code isnt complete and is quite off but if someone could take my blindfold off …

Member Avatar for WaltP
0
173
Member Avatar for nottoshabi

Ok guys I need some help with this code. I'm suposed to run this problem with it: [LIST] [*] Rewrite the program to include a static data member named numemps. This variable, which should be an integer, shoud act as a counter that is initialized to zero, and is incremented …

Member Avatar for WaltP
0
159
Member Avatar for Luckychap

hi, please any one tell me what is function overloading and overriding. and next one is on O.S. one more que. what is the difference between process and thread thanks!!

Member Avatar for ~s.o.s~
0
141
Member Avatar for kissiwat

Hi I've kinda hit an inspiration drought... Can anyone confirm that it is possible to return the value of several records within a linked list, add all the different values from each record, pass them as some sort of combined parameter into another file or record and be printed from …

Member Avatar for kissiwat
0
89
Member Avatar for lotsofsloths

OK, I have ben programming for about 6 monthes but never done real graphics!! I was wondering, how i could implement graphics into a program?? If this helps any i am using Visual C++ 2005 Express Edition...

Member Avatar for iamthwee
0
102
Member Avatar for rodkay

Hi all, I require some help using ifstream. I want to open a file who's name is made up in part by a user enter string - this is the format of the filename ... [code] "Airports_" << airlineICAO << ".txt" [/code] i did try the following ... [code] ifstream …

Member Avatar for rodkay
0
114
Member Avatar for i_like_pi

Hi, I'm a newbie to C++. I use Windows XP Home Edition and VC++ .NET 2003. I have just recently started creating large scale C++ projects with more than one file. I've been having troubles linking the files together. I solved the problem by adding "/FORCE:MULTIPLE" to the command line, …

Member Avatar for John A
0
101
Member Avatar for Dark_Omen

I am trying to learn how to comunicate with wireless acess points, just the basics like latency between the sources, signal strength, ssid, etc... But I can't really find any good resources on the topic. Does anyone have any good resources or know how I would go about using the …

0
93
Member Avatar for RossSCann

Does anyone use MFC? I have a problem executing graphics functions. [code] [COLOR=#0000ff]void[/COLOR][COLOR=#000000] CMainFrame::OnTimer(UINT idEvent)[/COLOR] { idEvent++; //when a time event occurs do some pointG2.y-=3; //graphics pointG=pointG2; TimerEvent(); [COLOR=#008000]InvalidateRect(NULL, TRUE); //to call [COLOR=#000000]OnDraw[/COLOR] [/COLOR]} [COLOR=#0000ff]void[/COLOR][COLOR=#000000] Csail_boatView::OnDraw(CDC* pDC)[/COLOR] { //graphics functions here //they compile OK //OnDraw is called by the even …

Member Avatar for RossSCann
0
127
Member Avatar for tigerkartik

hi im a student and hav t mak aproject on c or c++... so if anyone cud help me out

Member Avatar for apurv
0
89
Member Avatar for kishore5001

Hi i am new to the discussion forum and i want to learn cpp. Why destructor with ~ is used in cplus-plus coding for every constructor? Thanks

Member Avatar for Narue
0
88
Member Avatar for Matt Tacular

For my programming class, I have gotten to the lesson that involves overloading constructors and what not, but I have a problem with mine that I am possitive is a very simple syntax error or something. If anyone could be so kind as to take a look at the following …

Member Avatar for kishore5001
0
128
Member Avatar for Lazaro Claiborn

I've been trying to figure what I'm doing wrong all day. I'm becoming discouraged. Can anyone help me out? [code=cplusplus] void stripSpace(string &str) { int i,j,len=str.length(); for (i=0;j=0;i<len;i++;j++) if (str[j]==' ') { str.erase(j,1); j--; } str[j]='\0'; } [/code] I just won't seem to stop until I get this fixed!!!! Any …

Member Avatar for Lazaro Claiborn
0
153
Member Avatar for Duki

Here's my code... i put in some troubleshooting couts, but I can't figure out what's going on. #include <iostream> #include <iomanip> #include <fstream> using namespace std; int main() { const double INT_RATE = 0.10 ; const double FACTOR = 1.0 * INT_RATE ; const int START_AGE = 16 ; const …

Member Avatar for Salem
0
175
Member Avatar for Debadipta

I've recently installed Microsoft Visual Studio.NET.I want to know how to compile a simple C/C++ program printing "Hello World" as console output in Microsoft Visual Studio.NET platform.will remain obliged for d help!!!!

Member Avatar for Ancient Dragon
0
74
Member Avatar for gabs

I am trying to use chinese letters in a c++ program I'm writing. does anyone know how this can be done? I know that: [code]TEXT("[COLOR=#800000]\u03a3[/COLOR]")[/code] will print out a latin letter, so how do I get a chinese character, and perhaps there is an easier way? I need this asap, …

Member Avatar for thekashyap
0
126
Member Avatar for paeez

I want to search a name in my doubly linkedlist and remove it. I used strcmp(string1/string2) to see if the data part of the current node is the same as the data im looking for or not.but it didnt work. what can i do? [CODE] class node { friend class …

Member Avatar for ~s.o.s~
0
120
Member Avatar for Brent.tc

I would like to know how to read a value from the registry. And store that value in a variable... I use Bloodshed ide and ?mingw? compiler, NOT visual c++ so please do not give answers if they only apply to vc++.

Member Avatar for ~s.o.s~
0
3K
Member Avatar for MattTobin

Hello~ I'm working on a project in which we are suppose to create our own class seperating the class and the implementation. When i try to compile the .cpp file im getting 2 errors on line 10: 1. new types may not be defined in a return type and 2. …

Member Avatar for MattTobin
0
105
Member Avatar for nayrb

I am making a lunar lander game, i have made the class and implementation file, but have no idea how to make the altitude reduce by the formular. Alt = time * velocity Could you also help me out with how to make time pass through the game, no idea. …

Member Avatar for thekashyap
0
971
Member Avatar for proxystub

cant seem to read from this my file "d.txt", i know this is quite simple code but its just not working, and yes file "d.txt" is in the same directory as the .cpp & .exe [code] #include <fstream.h> #include <iostream.h> #include <stdlib.h> int main() { char ch; //int check = …

Member Avatar for proxystub
0
120
Member Avatar for niyiment

I am new to c++ and i dont know where to start from and how to get materials on c++ from any site or member. thanks in andvance

Member Avatar for Lazaro Claiborn
0
81
Member Avatar for arfmal

I have a problem - to copy a string from a vector and put it into another vector. It's ok if i use a string variable, where this variable will be used as a temp variable between these vectors....But i do not know what is the best approach to copy …

Member Avatar for thekashyap
0
242

The End.