49,761 Topics
| |
im making a class called BigInt it will store integers in an integer array, 1 digit per array location(just ask if you need me to clearfy any more).....i have to make an addBigInt operation, subtract,setBigInt that will store an integer value into an existing BigInt, e.g. x.setBigInt(-397) replaces the value … | |
Hey again! I've asked a question here once and have been lurking ever since. I was working on a new program and have come across problem. I don't really know what's wrong so I assume I overloaded something. The problem is in this snip of code [CODE]for(int m=0; m<num+1; m++) … | |
im quite confused on how typedef int (__cdecl *MYPROC)(LPWSTR); works exactly? how do you typedef a function? any explanation is greatly appreciated! thx :D [CODE]// A simple program that uses LoadLibrary and // GetProcAddress to access myPuts from Myputs.dll. #include <windows.h> #include <stdio.h> typedef int (__cdecl *MYPROC)(LPWSTR); VOID main(VOID) { … | |
[CODE]#include <iostream> #include <windows.h> #include <ctime> #include <cmath> #include <iomanip> #include <string.h> double numerator, denominator; static short multiplycounter; static short dividecounter; const double ten = 10; double* ppnumerator = &numerator; double* ppdenominator = &denominator; using namespace std; /**********************************************************************************/ double lcm(double numerator, double denominator) { if(*ppnumerator > *ppdenominator) { for(long counter … | |
For some odd reason, I can't get anything to be displayed when the program is running. I believe its not passing anything at all which would explain the blank console. If anyone could help me out that would be great. Without using functions the program successfully shows: 1) Student's name … | |
Okay, we had an assignment in computer class that I have been working on for awhile but what I've got so far isn't working. It seems that it may be a compiler issue, but since I can't get to a linux compiler (what the program will be evaluated on), and … | |
My problem is that I need to write a program that asks the user to input a number from 1-99 and outputs the number spelled in english. I believe that I have the general outline down in that I will break it up into statements using If and Switch statements. … | |
Im getting this error and I am so new at this that I have no idea how to correct it. If someone has any suggestions. Programming for 10 weeks! [CODE]#include <iostream> #include <string> #include <iomanip> using namespace std; int InputData(string [], int []); int main() { string players[99]; int score[99]; … | |
So I've been working on a program that takes a string and then puts it in an i * 6 char array but I can't seem to get it to work, any help with the problem would be much appreciated. Here is the unsatisfactory code I have so far: [CODE] … | |
At debugging the code, the program gives 2 errors Error 1 error LNK2001: unresolved external symbol _mainCRTStartup Error 2 error LNK1120: 1 unresolved externals | |
I am trying to learn C++ ifstream i came across this code on the net and have some question. void read() { ifstream inFile ("in.txt"); string l, i; int item = 0; while (getline (inFile, l)) { // is this one checking end of file like java? istringstream linestream(l); // … | |
hey guyz.i have a c++ code using structure arrays.I want to sort the records by id and by age(using 'sort' function)and by name (using 'sortN' function). My problem is i cant figure out how to pass the records to the relevant functions from the'main' function and also how to get … | |
I use Visual Studio 2005 on windows XP. I'm trying to use "Google Test" framework. But i couldn't manage to make just one test because of linker errors. I built Google Test, thank created new project. Then made the steps written in [URL="http://stackoverflow.com/questions/531941/how-to-setup-google-c-testing-framework-gtest-on-visual-studio-2005"]this link[/URL] to the project properties file. Than … | |
hye all :) can u help me with this code: [CODE]int list[4][4] ={7,23,12,6, 2,1,4,10, 65,15,33,8, 18,26,42,12}; int i,j; for (i=0;i<4;i++) { for(j=0;j<4;j++) { cout<<list[i][j]; } }[/CODE] there's output but i want it to display 4X4 | |
Hello, I'm having this problem in my code that I just can't figure out the reason to, I'm trying to set an integer value to an integer variable that's a member of a class that is part of an array member of another class. It should be an int = … | |
Okay so this is getting on my nerves now. Say I have a string like this "The average value for box 1 is:" and I have a float variable containing digits. How do i make the final result like this: "The average value for box 1 is: 12.01" ?? In … | |
Hey Guys n Gals Im a newbie here and I am having trouble with putting input into a two dimensional array. What I have to do is put the users numbers (integers not doubles) into a matrix add them, subtract them and multiply. I have most of my code written … | |
Hello it is my first time here and I just started C++ so hopefully my question isn't too dumb or anything: I was writing this thing that can do geometric series and arithmetic series. I can write the geometric series code alright and the arithmetic series code alright but once … | |
#include <iostream.h> #include <conio.h> #include <stdlib.h> #include <dos.h> #include <string.h> #include <stdio.h> #include <graphics.h> #include <process.h> char board [3] [3]; void rules(void); void help(void); void play(void); void restart(void); void credits(void); void draw(void); void printplayer(int); void printcomp(int); void result(void); char name[100]; void input(void); void input2(void); void mapboard(void); void main() { int … | |
[CODE]// istream get #include <iostream> #include <fstream> #include<string> #include<cstring> //#include<sstream> using namespace std; int main () { char c, str[256]; ifstream is; cout << "Enter the name of an existing text file: "; cin.get (str,256); is.open (str); // open file ofstream was; was.open("output.mvw"); string st ("There are two needles in … | |
My problem: I am now able to get the program to compile, however, when i call the functions to count the number of consonants or vowels, the numbers are not what I expect. Instructions: Write a function that accepts a pointer to a C-String as its argument. The function should … | |
Hi im a c++ beginner and i'm doing a tic tac toe program hollywood squares style only with math questions. what im trying to do here is im trying to insert a timer such that the player only has 20 seconds to answer each question or he/she loses his/her turn.. … | |
Well, i'm working on a text Editor. I'm still a little nooby with C++. I'm trying to create a Goto Line Command. Would someone give me an example of how to do it? Thanks :P | |
Hey guys. Im writing a console based application which i want to convert to a windowed application. however, i still want the user to be able to type in input and for my program to be able to output in a console based style, i'd just like the option to … | |
please help me guys :). I found several articles about preventing the user from entering characters but I can't understand them. [ICODE] int num_sub;//subjects setcolor(143); cout<<"Enter the number of subjects:"<<" "; setcolor(15); cin>>num_sub; if(isdigit(num_sub)==0){ cout<<"CONTINUE"; } else{ cout<< "\n numbers only!"; exit(0); }[/ICODE] here in my code: when I enter … | |
how can a user be able to type what ever he wants such as " i went to the park...", i tried to do it but with my string variable it only read the first word typed in, such as i in this case. please help. | |
[CODE]i understand int cars[23]; can be accessed using pointer notation such as... int cars[10]; int *carz; *(carz+1); // carz[1]; im curious as to what the equivalent pointer notation would be for a structure..for example struct car { int wheels; float gas; float engineHP; }; struct car cobalt; cout << cobalt.engineHP … | |
Next week I am going to begin learning about linked list, I know very little currently. Are there any well written explanations of linked list online? Or can someone explain the logic to me. Want to have a background before I start learning it from my professor. | |
Here is my code so far for my program: [CODE]#include<iostream> using namespace std; int main() { int number; int guess; char reply; srand (time(NULL)); number = rand() % 1000 + 1; do { do { cout << "Guess the Number" << endl; cin >> guess; if (guess > number) { … | |
I would like to know the difference between these listed. |
The End.