49,761 Topics
| |
Hi, I have a question on writing a c++ program can anyone give me a hand? | |
this code is not working as per its expected output.please tell me the errors and how to rectify them. [CODE] #include<iostream.h> #include<stdlib.h> #include<conio.h> int* getwaitingtime(int* proc,int* arr,int* bur,int noofproc) { int i,j,c[10],t,p,m,s[10],out[10],f,l; int *wait; for(i=0;i<noofproc;i++) { if((arr[0]!=0)||(arr[i]>arr[i+1])||(arr[i]==arr[i+1])||(bur[i]<0)||(bur[i]==0)||(bur[i]>10)) { return NULL; } } for(i=0;i<noofproc;i++) { c[i]=arr[i]+bur[i]; } for(i=1;i<noofproc;i++) { for(j=1;j<noofproc;j++) { … | |
My C++ course hasn't covered a topic yet, but I'm expected to solve a few problems with this material. I've got some working code I just don't fully understand it. Can someone help me, please? [CODE] void f(int** a) //What is this ** business? (1) { cout << **a; //prints … | |
hello ! I`m trying to use sqlite database with c++, but something isnt working right... The problem I`m dealing here is that i cant insert other datas into the table i`ve created except NULL, because i get following error message: Error in select statement : INSERT INTO a (a,b,c,d) VALUES … | |
The question is in the title. I am trying to make an image that includes this character... *typo in title. It should say 'do', not 'to'.* | |
how do i get int in fstream? i am in need to change my char to int. i am not allowed to use anything above and including fuctions. this includes sstream. is there any way for the program to read "3" in the program as an interger? | |
i need to know how many times the while loop is done. while (myin) { myin >> name; cout << name ; myin >> num1 >> num2 >> num3; cout << " " << fixed << setprecision(0)<< num1 << " "<< num2 << " "<< num3 ; average = (num1 … | |
what i have so far - [code]void do_handleclient(int connsock,struct sockaddr_in *client_addr) { // Communicating with our new friend. string buffer, execmd, filename; int b, n, nstr, str; char buf[25000]; char *cbuff=(char*)buf.c_str(); while((n=recv(connsock,buf,25000-1,0))!=0) //receiving request. buffer[n]=0; while(buffer[nstr]!=' ') { //pulling GET or POST command out of request. execmd[nstr]=buffer[nstr]; nstr++; } while(buffer[nstr]!='\r' … | |
So I have a coin flipping program that ouputs all results to a txt file. I was wondering how would i search the results so that I could pick out things like how many times a specific result was repeated in a row. For example if the results were Heads … | |
CSCI 1170: Open Lab Assignment #5 Program due: Thursday, Oct 29, 2009 at midnight as the day turns to Friday Oct 30, 2009. Professor: c8296800 code: ola5 Purpose of this assignment: The purpose of this assignment is to understand the while loop programming construct. This assignment will let you 1. … | |
Hello everyone, I'm new here and I'm looking for some help because I'm a beginner at c++, and I'm learning right now, I got a problem that i don't know how to solve, Here is the problem: Suppose we have 10 lines in a file and 4 input values in … | |
Error 1 error LNK2019: unresolved external symbol "public: __thiscall vector::my_vector<int>::~my_vector<int>(void)" (??1?$my_vector@H@vector@@QAE@XZ) referenced in function _main test.obj Error 2 error LNK2019: unresolved external symbol "public: __thiscall vector::my_vector<int>::my_vector<int>(void)" (??0?$my_vector@H@vector@@QAE@XZ) referenced in function _main test.obj Error 3 fatal error LNK1120: 2 unresolved externals C:\Users\...\Documents\Visual Studio 2008\Projects\Iterator and Generic Vector Container\Debug\Iterator and Generic Vector … | |
Hi, I have posted in a previous thread about this problem, but this seems not related enough to post in it. My problem is with this code: [code]//This is VERY simple, will just graph a y=mx+b type formula into 2 arrays. #include <iostream> using namespace std; int main() { //Counters … | |
i got to do this for my class and i am a total noob! i don't know what to do from this point on. first, i need to use fstream to do this. 3 Tracy 80 91 67 Dana 0 66 44 Scott 50 41 64 Jamie 82 90 87 … | |
i have this Tracy 80 91 67 and it is read from a file, making it fstream. i want the computer to reconize the numbers and add them and divide them, excluding the name. how do i do it? i can't use fuction so please make it easy. | |
Alright, I have an assignment in which I have to use ANSI Escape Sequences to colorize output on the console. So "\033[0;31m" colorizes text after it to be red for example. When I run the following: [code]cout << "\033[0;31mhello \033[0;37mworld";[/code] It works as it is supposed to, with "hello" printing … | |
Hi, I am trying to understand the concept of clone with respect to making a deep copy of an object. The class Bmapfile is an abstract class in which other subclasses will inherit from. I am not sure what to put into the doObjCopy function in Class BaseClass. I want … | |
Hi, I am very new to C++ programming. I need to do some work urgenty..... I have a video file with some conversation going on... I need to extract the speech transcript (possibly in a text file) Please help me seniors and give me some ideas... | |
So I would like to make a function which would add elements in container in sorted manner. Let's say we have a struct with two integer. I randomly initialize them and the add it to deque. And now what I want is that my function would add them in a … | |
i have a project for my programming class where we have to create a binary search tree and then when the program exits we need to save the tree to a text file and then restore it when the program opens. the basic functions were given to us, but the … | |
I'm trying to figure out how to even start a program that removes suffixes like if i were to enter programs, are, not, limited, to, drawing, composition, it would output.... program are not limit to draw composi | |
Hi, My knowledge of c++ is limited to basic syntax used in basic programming assignment while I have some years of software development experience (particularly web application) using java. I have not created any thing big in c++ ever. Now coming back to c++ at present, I am confused how … | |
Hi, hope someone can help with an issue I'm having. Basically, I've got an input file containing, amongst other things, an int on each line representing a time stamp in the form of hhmmss. I needed to make a comparison from line to line to make sure that no more … | |
I am trying to do a function that is a textBox contains 2 dots (.) then the last dot(.) will be deleted, so it wont be possible to write 2 dots(.) in this textbox. When I write the second dot in this textBox, then also the first is deleted, for … | |
some of the characteristics of a book are title,author,publiser,ISBN,price and year of publication.design a class booktype . 1) each object of the class booktype can hold the following information about a book:title upto four authors,publisher,ISBN,price and number copies in stock. To keep track of the number of authors ,add another … | |
Hey guys I am trying to print the contents of a map container I have. I seem to be getting a nasty error from the compiler which seems to come from the pos = wordList.begin() part. any suggestions? [code=cplusplus] map<string, unsigned>::iterator pos; for(pos = wordList.begin(); pos != wordList.end(); ++pos) { … | |
[CODE]#include "stdafx.h" #include <iostream> #include <string> // say what standard-library names we use using std::cin; using std::cout; using std::endl; using std::string; int main() { // ask for the person's name cout << "What's your name? "; // read the name string name; cin >> name; // build the message that … | |
I know this might seem like a repeat of an already existent thread, however give me a moment to explain... What I have so far is a function that reads in a script file and stores each word in an array of custom objects. function: [CODE] void fileTester::readFile( string tempName … | |
Hi, was wondering if anyone could put this simple pseudo code into c++, i have not yet learned the code to do it and dont want to wait. If someone could post it i would appreiciate it a lot, thanks! BEGIN Enter # Clear Screen Count = 0; WHILE (Count … | |
how to deallocate memory in a c++ program dynamically without using destructor?plz help me. |
The End.