51,593 Topics
![]() | |
Hello all! So im taking a C++ class and I'm supposed to make a grade book program that will take in 6 programs grades and 2 test grades, then multiple the average of each by 50% and add them together for a letter grade... So that was the first project … | |
The problem resides below - I'm trying to make a directive command that disable one constructor definition, or the other, based on the parameter of T. When I uncomment the block around the if statement, I get this error-- [ICODE]... missing binary operator before token "(" [/ICODE] --but when I … | |
Hi All I was working on a proj in which I wanted to go through various directories one after the otehr using enum. Now say from root node 2 branches are coming out- US and Japan and from each of these are further branching into CA1 and CA2. So the … | |
hi i have aquestion i really need an answer for it because it frustrated me... [B]look at these two functions:[/B][CODE]void CSecondDlg::OnButton1() { //**BROWSE DIALOG 1**// FILE *fp; FILE *file1 = fopen("file1.txt","w"); //Create txt file for saving editbox content int nFileLong; //***********************************************// char strFilter[] = { "CPP Files (*.cpp)|*.cpp|All Files (*.*)|*.*||" … | |
hai this is manoj. i am doing mca 5th semester and i need to do mini project .iam interested in doing project on c++.can iget suggestions regarding which project will be better to do. thanku | |
hello, been googling this for a while and can't come up with anything good, so hopefully this won't be so easy to answer that it makes me look lazy. I'm writing an application for linux (gcc compiler) that calls various system and custom commands from inside my own program, nothing … | |
Here is my question Write a command line program titled joinTextFiles.cpp that concatenates the contents of several files into one file. For example, the following command line [B]joinTextFiles chapter1.txt chapter2.txt chapter3.txt book.txt[/B] will create a long file titled book.txt that contains the contents of the files chapter1.txt, chapter2.txt, and chapter3.txt. … | |
Okay so I'm trying to learn the basics of C++ from a book which is I think, well I know, a few years old. I already came across a couple of problems; Firstly the <iosteam.h> thing, which can technically be rectified by using -wno- deprecated in my djgpp compiler, but … | |
Hello :) I'm making a (new :P) game in C++, and in the beginning of the file, I'm initializing an array like this [code] int tower_dmg[5][3]; int tower_spd[5][3]; int tower_eff[5][3]; int tower_efc[5][3]; int tower_cst[5][3]; [/code] And later in the program, when loading images and initializing a lot of stuff, i … | |
Hi. I've searched the daniweb question database, and was not satisfied with solutions I found there. I have a string that looks like this... "100 1.745329252 0.984807753 -0.173648178 -5.67128182" not exactly words, but I want to select say, the third "word" of this string (0.984807753) into a variable. The whitespaces … | |
I know about using ran() to create a random number between x and y, however i am creating a banking program and i am wondering how to randomly generate a 17 digit pin, then store the pin in an outside file, then have the program check the file for the … | |
I am a first year IT student cramming my last assignments in before the monday afternoon deadline. I am battling with a problem that looks like this: I have to create a program using the case statements to choose a winner from rock, paper, scissors and count the wins,losses,ties to … | |
hi everybody, these two codes returns pointer to an object declared and defined within the function. yet both of them prints the correct value of the variable c in main(the values of variable c should have been destroyed when the call is over.). the first code gives the warning. but … | |
Hi, I'm having a problem understanding this thing. Suppose I have a function that returns a generic value. Inside I have "try" and "catch" statements for exceptions. Now once those exceptions have been detected, what and I mean in the name of Jesus butt-hole is my function suppose to return? … | |
What's used to storage 2d data like this: ID --- ITEM ------ TYPE ------ PRICE ------ WEIGH 1 ---- hammer ---- 3 ---------- 1300 ------- 67.0 2 ---- sword ------ 2 ---------- 800 --------- 42.0 3 ---- katana ----- 2 ---------- 2200 -------- 21.0 So I can acess it to … | |
Please... help... in file is complete project . please..help..i need this so fast.. i need managed to make windows forms.. before this project i made a small project and all was ok.. and now.. help | |
Back with another question concerning my RPG. I had the idea to do a multi-dimensional array to represent a map, with each element in the array being it's own square, Depending on where you are, you can move in any of the 4 directions, unless you are on an edge. … | |
Below is my problem... I think section 1-3 are okay, but I am having problems with sections 4-7, Any help would be great. I also need to load these from a file... I just loaded the array by initializing the values as I thought I could start there check my … | |
This one actually tells me visual studio has a problem and needs to close this code. I'm sure it's in the insert/write section, but I'm not sure what I did wrong. I'll post the rather simple cpp below it. [code] #include <iostream> using namespace std; template <class T> class list … | |
If you grab this code and run it, you'll see what I mean. The second half doesn't run, and when I can get it to run, it's all completely wrong. I'm trying, but I'm tired and just want to get it done...lol. The encrypt and decrypt are a separate cpp … | |
Hi. Does anyone know how to execute system() statement in a DOS Emulator like DOS BOX. For example for the following code : [ICODE]#include <stdlib.h> #include <stdio.h> int main(void) { printf("About to spawn command.com and run a DOS command\n"); system("dir"); return 0; }[/ICODE] It only displays "About to spawn command.com … | |
Hey, my dad was checking the "lotto" results so that inspired me to make a little program of my own, i accomplished that just got a problem.. [CODE=C++]#include <iostream> using namespace std; int main() { srand(time(NULL)); unsigned int lotteryBall; for(int i = 0; i <=7; ++i) { lotteryBall = rand() … | |
Can getc()/putc()/fgetc()/fputc() be used to read/write chars and floats rather than ints only from binary files? If so, how? | |
how do i determine the smallest nr of an input of three hours in a 2D array? the program is that you must have an input of 3 hours for 3 modules for each studend(4) | |
I found an interesting question on the internet... An interviewer asked a programmer "How would you divide without using division or multiplication?" And the programmer came up with some weird bit shifting operation that did the division. Now, I'd like to make a program that does something similar, since-- int … | |
Hi all, With some help of others, my code now works. To those who helped-- again, thank you; immensely! Yesterday, I stumbled across the form builder in VS Express 2008. I've built my forms-- via the new-fangled drag/drop that I've come to love so much (as opposed to writing/typing them … | |
I'm having this weird issue with a text based RPG I'm trying to create. I'm fairly new to C++, so I thought having a project that I can work on and expand as I learn more would be a good way to put what I have been reading about into … | |
Morning all. Hope everyone has great weekend. Once I get done posting this I'll be digging yet another hole for my spinkler system, and hopefully finishing off my drip system for more backyard. Ok.... Onto my issue. After a week of struggle to find out why I kept getting errors, … | |
If this is the original class: [code] class StorageBin { public: StorageBin(); ~StorageBin(); void PutInBin( int Item, int Location); int ReturnFromBin (int Location); bool FindInBin(int Item); void DisplayBin(); private: int *pBin; int NumberInBin; int BinSize; }; [/code] Would this be the correct conversion to make it a template? [code] Template … | |
This is the code I've written for a homework assignment - however in the footer for Cases B & D I have no idea what I should have for coding to get the correct count - any help/comments is greatly appreciated! /* as long as actual birthday has occurred life … | |
ok before someone points me to google or to the search box, let me state that I have already done the searching. The solutions I get either state using winsock(which happens to be windows only):( or parsing the output of ifconfig(which happens to be linux and maybe unix only):( and … | |
Hi i just wanted to ask whether we cud use #include<string> and declare a data type called 'string' eg. string ch;? and where is "using namespace std" used? | |
When I'm opening a file, is it the file that is text or binary or is it the stream that can be text or binary? Also, when I close a file is that when the stream object is destroyed? | |
hey there, im new on C++ and have to do an assignment where i have to display names of soccer players and the number of goals and cards received. im busy with my first function, and if someone can help me i would realy apreciate it. //question 1 assignment 4 … | |
GREEDY COUPLE A party game has the fourteen party guests sitting in a circle on chairs numbered, in a clockwise direction, one to fourteen. A cup of beverage is passed from person to person around the circle in a clockwise direction, starting with the person sitting on chair number one. … | |
Hi people, who know how to use double buffering in graphics.h library? I have some problems with blinking, so I would like first write objects to bitmap and than to screen. Can anybody help me? | |
[code=c++] #include <cstdlib> #include <iostream> /** Test Class for learning template-metaprogramming */ using namespace std; template<int N> //General case for a number class ShowValues { public: static inline void show() { cout << "Start: " << N << endl; ShowValues< (N > 1) ? (N - 1): 1>::show(); cout << … | |
Hello, Does anyone know how to use _popen in windows xp sp3 (console application) to allow writing to a process? I've tried using _popen to read from a process. This works as expected. When I try _popen with write access, the process starts, but no commands are interpreted. My code … | |
[code] #include<iostream> using namespace std; class welcome{ public: welcome(){ cout<<"Constructor"; } }; int main(){ welcome c; return 0; } [/code] for the above code i get the following errors wen i try to compile using GCC in PCLinux minime version. cannot figure out if there is an error in my … | |
Okay. I play a game called chain of command. It's abandonware, the original designers went bankrupt and the source code got lost. The server and game files and such were all on a backup server and acquired from one of the original designers. I was just told we need to … | |
Ok, so im doing an assignment and Here is the question: -------------------------------------------------------------------------------------------------- Using the base class Person which has two member variables called name and birthday [both of type string], derive two separate classes from Person, called Student and Professor. The Student class has a major [string] and a gpa … | |
I am using Maps from the STL to insert a polynomial. The Key is the exponent and the data is the coefficent. Basically I want to add/subtract and multiply them. I have the addition/subtraction down but when it comes to multiplying I have to add the exponents and multiply the … | |
I was doing well in this project until I was trying to do the math problem on the third class. The project is, we are supposed to create a base class of circle and create 2 derived classes The first is sector derived from circle then the segment is derived … | |
very simple question: what is the most easiest way to do the following I have two variables a=1; b=2; how do I make it that c= a,b so that c=12 I dont want to write [code]c=12;[/code] because a and b change according to user input. Thanks, this should be solved … | |
Hi there.... 1stly sorry for the novice and beginner question but I really need help since I've been get fiddling to figure out the error but still have no idea whats wrong with it...here are's the code I'm using[code] #include <iostream.h> #include <stdio.h> #include <conio.h> #include <string.h> #define MaxSize 100 … | |
Hello community. I am writing a program that will use multiple threads to run MATLAB functions inside of Cpp by using the MATLAB compiler to create a DLL. I have already written the MATLAB DLL and I have everything linked up just fine, but now I need to split this … | |
Hey, here are two codes and with one slight difference they do different things [B]CODE 1[/B] [code] #include<iostream> using namespace std; int main() { char array[2]; int i=0; while (i<2) { cin>>array[i]; i++; } cout<<array[0]<<' '<<array[1]; } [/code] [B]EXAMPLE OUTPUT:[/B] [code] two words t w [/code] [B]CODE 2[/B] [code] #include<iostream> … | |
Below did not work. Is there anyother way? #include<stdio.h> #include<math.h> const int No=2; int* mat_sum(int[][No], int[][No],int); void main(){ int A[No][No]={{0,2},{0,1}}; int B[No][No]={{0,1},{1,0}}; int *Result=0; Result=mat_sum(A,B,No); } int* mat_sum (int A[][No], int B[][No],int length){ int *C=new int[No][No]; for (int i=0;i<length;i++){ for (int j=0;j<length;j++){ C[i][j]=0; C[i][j]=A[i][j]+B[i][j]; // printf("%2d",C[i][j]); } } return C; … | |
Hello, I was wondering if it was possible to take a string variable or an integer variable and send it to another computer like client/server architecture and also read that data from that same computer. I am thinking that winsock will be ideal for doing this but if anyone knows … |
The End.