48,986 Topics
| |
I want to print to a word of length n in a string .Using by C ++ langues.I have not know funtions in string.h support that. i'm happy when you help me! thank you | |
Hi! I'm trying to use the nanosleep and sleep functions in a program I am trying to write. I first tried this - [CODE] fprintf(stdout,"Hey guys.."); struct timespec t_req, t_rem; t_req.tv_sec = 1; t_req.tv_nsec = 500; if (nanosleep(&t_req, &t_rem) < 0) return 0; fprintf(stdout,"...What's up?");[/CODE] Since the function nanosleep did … | |
I am trying to get into the course to get an advanced diploma in professional games development, and I need to present a program to demonstrate my programming skills. Can someone give me some suggestions of a program to make that demonstrates that I know C++? | |
[CODE] void MatchWord(Match temp, int duplicatedoc, int originaldoc, string * words) { Idea is to send in a match and then call the binary search on the matching words and see if they are found. If they are found, give them a higher weight and if not found, give it … | |
I am attempting to write some code that will open a sequintal file into arrays and will then can use the data to calculate monthly payment. the text file is as follows 1 5 10 20 50 2.5 4.1 5.3 7.1 8.3 With the top row being yrs and bottom … | |
So my teacher has a quiz question and his practice question for it is for us to code the strcpy function for character arrays assuming acceptable ones are passed. I have written my version and just want to see if it you see any errors in it. Or even if … | |
My assignment is to find the sum of an array, sum of the cubes of the array (i.e. each value raised to the power 3) and the variance of the array. At the moment I'm getting compilation errors so I can't do any trial and error. My problem conceptually is … | |
I'm having some trouble translating the following C++ program to Pep/8 assembly language. Can anyone help me solve this. This is what I have come up with. [code=cplusplus] #include <iostream> using namespace std; int list[16]; int i, numItems; int temp; int main() { cin >> numItems; for (i = 0; … | |
ok, i have a bigger problem. when i run the program (something like this); "Which swimming instructor would you like to choose? Enter j for Jeff, Enter a for Anna j Please enter the first letter of the day of the week you would like to schedule. M for Monday, … | |
I was wondering how to make a program to open a specified file just by entering its location. What command do would i use to open it instead of double clicking on the file. Thanks in advance. | |
OK, i can't figure out what kind of mistake I've done. Can somebody help me please. [CODE]#include<iostream> #include<iomanip> using namespace std; void scedulejeff (char [][4]); void sceduleanna (char [][4]); void Print2DArray(char [][4]); int main() { char jeffarray [4][4]; char annaarray [4][4]; char instructor; cout << "What instructor would you like … | |
Hello.. I m doing my project in vc++ CLR windows form.. I m using vc++ 2008 express edition.. When I click button of my form , i wanna include a pop window.. I m not getting any syntax to include pop window.. As i m beginner to vc++ , i … | |
ok I'm confused... my class is empty, apart from an inclusion file, but has alot of errors that i cant understand.... Here's the .h file: [CODE] #ifndef creator #define creator #include "stdafx.h" class creator { public: creator(); ~creator(); } #endif [/CODE] And here's the cpp file: [CODE] #include "creator.h" creator::creator() … | |
Hello :) I've got this resource (as in files on the pc) management system, that had been tested but now seems to be malfunctioning. I've been debugging for way too long now, and I can't figure out the issue. I'm going to post some of my code first, and then … | |
Does anyone know of a good way to sort an stl map? I have something like the following example: [code] #include <iostream> #include <map> #include <algorithm> int main() { map<int, float> map_to_sort; // Populate the map with between 20 - 2000 elements map_to_sort.sort(); } [/code] Obviously I am aware that … | |
hello i'm really new at this and i dont ever know where to start can some one please help me start my project.... The Project is in a attachment at the bottom.... Please help and thanks... | |
Hey, I have to write a program using vectors that will input a list of positive integers terminated by a negative integer and output the unique numbers in the list in ascending order? Can anyone help me get started? | |
hello, [B]I have an assignment for my one class at school where I am supposed to write a program that creates lists of people who have met. Each line of input is a space-separated list of the names of people who have met. If a person is in a group … | |
I have this Lab for a class that I am taking.. It works as it suppose to... The problem I am having is that if I enter more than 11 char it goes all crazy.. I don't want it to do that... [CODE] #include <iostream> #include <cstring> using namespace std; … | |
Hi all, I have to write a program that will input a string and convert the string to an integer value. The program should then output the integer value multiplied by 2. Also im not supposed to use any built in functions.Can anyone help me? Thanks a million! Sana Zafar | |
The X424 is a 16-bit machine with a 16-bit address bus. There are 2^16=65536 memory cells, numbered 0 through to 65535. Each memory cell is 16-bits wide. The machine also has 16 registers, numbered 0 through to 15. Each register is 16-bits wide. Register 0 is the stack pointer. • … | |
I KEEP GETTING THESE TWO ERRORS: 1. error C2011: 'vehicle' : 'class' type redefinition 2.see declaration of 'vehicle' [CODE=c] #include <iostream> #include <string> #include "vehicle_imp.h" //IMPLEMENTATION vehicle::vehicle() { x = 0; y = 0; speed = 0; facing = 0; } void vehicle::turn(int facing) { facing=facing+90; if(facing==360) { facing=0; } … | |
Hello everyone, I am trying to understand composition versus inheritance in C++. I have looked at many web pages, but I haven't found anything that makes sense to me. Can someone please tell me where I can find some examples of programs that might make sense to me? I am … | |
I saw few treads referring to this subject but I just can't get this working includs.cpp [CODE]#include <iostream> using namespace std;[/CODE] main.cpp [CODE]#include "includs.cpp" #include "ispis2.cpp" int main() { ispis(); system("pause"); }[/CODE] ispis2.cpp [CODE]void ispis(){ cout<<"tets file"<<endl; }[/CODE] After compiling this I always get the flowing error [CODE]error C2065: 'cout' … | |
Ok, I have a class project to basically design a program that handles classes and vehicles. What I have so far is far from the ending product. I have made 3 classes, car, vehicle, and motorcycle. Car and motorcycle are dervied from vehicle. The car class has a set const … | |
Let's say "a" is a char and "b" a string. Why does it take longer to compute b+a than a+b? Strange, isn't it? | |
I need to capitalize the first word of each sentence from a text file and make the rest lowercase. the text file looks like this: April 7, 2010! here is some TEST data to see if THE prOGRAm will work. "what do you know!" wiLL IT? anything with '.' '!' … | |
Hi all, in a piece of code like this: [CODE] void Logger::logMsg( int msgLevel,const char* msg) { char input[strlen(msg)]; ... } [/CODE] is the input array dynamically allocated? In this case, do I have to use the delete [] in order not to have a memory leak? thank you! | |
[CODE]#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { char a_char; int cu = 1; while (cu != -1) { cin>>a_char; cout<<"Is a digit!" << a_char << endl; } system("PAUSE"); return EXIT_SUCCESS; }[/CODE] When I input a132, the output is: [B]Is a digit!a Is a digit!1 … | |
This is probably a really stupid thing to ask considering the development I'm doing (effectivly creating a virus scanner), but how do I link classes/cpp files? I have 3 applications/sections that I can compile/combine with a makefile, that's fine, but I need them to run 1, 2, 3 once the … |
The End.