49,757 Topics
| |
The assignment my instructor has assigned as for to read an input file and count all 3, 4, 5, and 6 letter words and out put those to an output file. From what data I had been provided by my instructor, I think he wants us to use char data … | |
my os : windows xp sp3 compilers : gcc 4.5(minGW) IDE : code blocks 10.05 As the title, when I didn't enable the command [b]-std=c++0x[/b] CImg can work with gcc4.5 and code block(after Build Options > Linker Settings > Link libraries > Add and enter gdi32) Or use this kind … | |
hi, i'm did a program in C++6.0 that retrives data from Access. the program was ok and runs normally for quite sometime and suddenly the error [B]"Unable to Create File Buffer"[/B] appear. After searching high and low for solution and trying multiple suggestions, i found that that problem is because … | |
how to transform from double to int (rounded) ? by using basic stuff ? | |
How Would i be able to check for valid input on cin or getline heres what i have [CODE] #include <iostream> #include <string.h> using namespace std; int main() { string word; getline(cin, word); cout << word; system("PAUSE"); return EXIT_SUCCESS; } [/CODE] what i mean by valid input is either if … | |
How do I change it so that it will only say how many times the program has ran once I typed another key then [B]y[/B]. Output: ================================= Programmer Name: Peter Langlands Program 3 Description: CS 150 Spring 2011 Lab CRN: Date: ================================= Enter an nonnegative number: 10 a0 = 10 … | |
How would I make this program that it tells me the number of odds or evens. I only have 1 number at the time, so I need it to either say 1 odd or 1 even. [CODE]#include <iostream> #include <fstream> using namespace std; void printInfo(); int nonNegative(int a, int k); … | |
I'm new to C/C++ and I'm having difficulty with calculating leap years in my Zeller's Algorithm program (based off of the Gregorian Calendar). I've lost sleep over this code for the last week and this is my final breaking point. I continually get "This day is Friday." for input 1 … | |
i have a empty c++ win32 console program Peter.cpp and a window form John.h added. a error of " error C2061: syntax error : identifier 'John' " just comes out due to the code " Application::Run(new John); " when complie. could you please help me to fix the program? thank … | |
Hello, I am looking to simulate keyboard inpout for a computer in general, not just for a window. I was allready told how to simulate keyboard strokes in a certan window, although I just want to simulate them as they might be in general. As in program says "X" and … | |
I NEED HELP!! I'm writing a program where the user inputs the pH Level and it goes and tells if it is a certain solution. Some of them work some don't Can somebody tell me where in my code I am going wrong. I am not asking for the solution … | |
can anyone tell me if it is possible to connect to a database (for example an access database) from visual c ++ 6.0? And if one can how does one do it? Is it some wholy complicated thing or is it as easy as doing it in visual basic 6.0 … | |
How can I go about concatenating two arrays of char(ex. char boy[] and char girl[]) so that the contents of girl is attached to the contents of boy? | |
I have searched but i can not seem to find an answer to my problem. I have to write a program that lets the user enter their salary, and calculates their salary with a 5% raise for 3 years. When I run the program and enter the value for cSalary … | |
[CODE] #include <iostream> #include <cstdlib> #include <cstdio> #include <fstream> #include <string> #include <vector> #include <sstream> #include <list> #include <limits.h> using namespace std; class Node { public: string name; vector<string> edges; vector<int> dist; }; class Path { public: vector <int> distance; vector <string> fromwhere; vector <int> complete; vector <string> cities; vector … | |
Hi, I am getting an error message when using base classes. The error message is x: undeclared identifier y: undeclared identifier z: undeclared identifier The particle class derives from the fourvector class which derives from the threevector class, as follows. [CODE]#ifndef THREEVECTOR_H // Prevents the class being re-defined #define THREEVECTOR_H … | |
Alright, I have some questions. 1. This code does make some sense right? 2. I keep getting my failure to open file message, did I make the program do that or are my test files just not working? 3. How do I make the program acknowledge - and + as … | |
In this program everything work except the change back, the quarters, dimes, nickels, and pennies wont work, everytihng else works, for my input i used 65.67, which with hst came out to 75.52, the amount tendered was 100. I just need help with getting the quarters, dimes, nickels, and pennies … | |
Hey, I am having trouble trying to set a default value for a function in one of my classes. Here is where I am trying to set it: [CODE] void Sprite::Spr_Blit(SDL_Surface* source, SDL_Surface* dest, SDL_Rect* clip = NULL) { SDL_Rect offset; offset.x = getX(); offset.y =getY(); SDL_BlitSurface(source,clip,dest,&offset); } [/CODE] Here … | |
I need help to make this program be output *******E * ** *** **O****> *** ** * *******E Thanks for helping | |
Hello, I've been searching the internet and i haven't been able to find anything on my problem. Anyways, I'm trying to read cursor positioning on my screen, and send it to a variable. Just to make things easier, what would I type in the code region for a button; [CODE]private: … | |
x =5 while(x<7) print the value of x x=x+1 while(x>2) print the value of x x=x-2 so i was thinking that the output of the program will be 5677753 but my program is against my opinion so i want to know the right output #include <iostream> using std::endl; using std::cin; … | |
hi,please help me with this program ,iwant it to print values of x not x #include <iostream> using namespace std; int main() { int x = 5; while(x < 7) { std::cout<<" value of x"<<'\n'; x=x+1; } while(x > 7) { std::cout<<" value of x"<<'\n'; x=x-2; } return 0; } | |
If I have this structure: [code] class Parent { public: virtual void MyFunction() {// do something} }; class Child { public: virtual void MyFunction() {// do something else} }; [/code] The Parent::MyFunction() seems to always be called, even with: [code] Child MyChild; MyChild.MyFunction(); [/code] Is this expected? David | |
This is my failed attempt at creating the Sieve of Eratosthenes. Can anyone spot any problems? I just started to learn the STL, but the concept of iterators and the STL in general is really difficult for me. -The input represents the number of cases. The variable m represents the … | |
Hai guys, I am a newbie here, maybe you know about my problem. this is VB source code : [COLOR="Red"][B]ReDim[/B][/COLOR] parent.Individuals(maxPop) As Individual [COLOR="Red"][B]ReDim[/B][/COLOR] offspring.Individuals(maxPop) As Individual Do While bil < maxPop bil_gen = 0 [COLOR="Red"][B]ReDim[/B][/COLOR] parent.Individuals(bil).Gen(batas_gen) As Genetik parent.Individuals(bil).Genome = AssignValue(1) List3.AddItem parent.Individuals(bil).Genome bil = bil + 1 Loop … | |
[CODE] // Hangman Redo Program #include <iostream> #include <string> #include <cstdlib> #include <ctime> #include <string> #include <algorithm> using namespace std; //Functions void welcome(); void instructions(); void game(); // Types and Arrays string choice; string inst; int main() { welcome(); return 0; } void welcome() { cout << "\tWelcome to Hangman … | |
| #include<iostream.h> struct rectInfo{ float height ; float width; float area; float perimeter; }; /* write a function void gendata(rectInfo * r)to generate and assing values to the height and width member of r(value should be b\w 1 - 20 )*/ void gendata(rectInfo * r) { } |
[CODE]#define _LL_BUFFSIZE_ 2048 string lastLine; lastLine.clear(); // regardless, zero out our return string char buff[_LL_BUFFSIZE_]; // our temporary input buffer data_filet.seekg (0, ios::end); // go to end of file int length = data_filet.tellg(); // find out how large it is data_filet.seekg(length-min(length,_LL_BUFFSIZE_),ios::beg); // seek back from end a short ways // … | |
Hey, Im having some trouble with my code, it doesn't seem to stop to wait for an answer to the question about modifying the phone list when i input values in above and press Ctrl Z enter, however the code works fine when i remove the code about inputting information. … |
The End.