49,761 Topics
| |
I have a list of about 500 names in a text file, i want to be able to get 5 random winners from this file. using C++ how do i do this | |
With what programming languages can you write OS in. I know that you can use C and C++ but are there any other, when i talk about OS i mean everything: from the BIOS & Boot & Kernel & all the rest that is neede to make an opersting system … | |
Pretty stumped on why I am getting so many errors trying to get this to work, the reason terminalArray is not declared is because this is a function, terminalArray was declared before main. Any help will be greatly appreciated! int histArray[10]; int i; int j; while (terminalArray >= 1 && … | |
this is my server code i want to receive more than 1000000 bytes ,so the data should be splited into many packets so i use loop to receive all data ,if i use like this server always wait for client even client sent all data to server ,my messsage is … | |
Hi! I made a program that accepts random numbers, create a binary tree from it, then traverse it using in-order, pre-order and post-order traversal. The program is working well but my instructor added something else, when the user input numbers, it should be arranged just like an actual tree. The … | |
Hello guys i am writing a c++ code that should do the following: 1- Creating a stage group just like the champions league first round consisting of 4 teams each on has 4 attributes ( points, gf, ga, gd) 2- The user must be asked to enter each team name, … | |
I wrote a linked list program in C++ which compiles and works well. But I have been told that a) I have to have two separate structs instead of one that contains both the info and the node; and, b) that I have to use two pointers instead of the … | |
I think I am comparing something incorrectly since it does take in my input and tells me no shortest path.. here is example input and output... 5 7 0 1 1 0 2 2 1 3 6 1 4 4 2 3 5 2 4 7 3 4 3 you … | |
Hi guys, I'm trying to use the random number generator as part of the GSL library and it is working fine for a few hundred 'rounds' of my code (it is used quite a few times per round) but then i get an error message in the command window: [CODE]gsl: … | |
I have to write a program that checks whether a sentence is a palindrome or not.I had no problem checking a word, but checking a sentence that contains spaces and quoatation marks made results incorrect. Basically to solve the problem and ignore the spaces and marks, I copied the initial … | |
Hi All, I am working on a program where I want to keep the length of message in bytes to further working on it. the message got this string in it. [CODE] message^ m = gcnew message("usa.weather");[/CODE] I have to keep the length of this argument that is routing key … | |
Hello, I want to learn how to make a syntax highlighter in vc++ 2010. What should I do? | |
This is embarrasing. My name is Leonard Norwood Jr. And I have problem concerning my program that does a simple program of multiplying a person's weight times the weight of the planet equals the weight they would be if they were on a planet. And this has to be done … | |
Ok now i am having a retarded issue im sure. but here is what is supose to happen is n is not allowed to be more than 5 but when i run this and enter in 5 i get a blank space and when i enter 1-4 i get the … | |
How can I read a string within a string without using substr? void ReadStrInStr() { string Str; Str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; //cout "A-J" in Str } | |
A password is good if it has at least one digit,one alphanumeric charecter, one uppercase letter, one ordinary lowercase letter letter and consists of 8 charecters or more. I created this program, but I'm not getting correct results.. What is the problem? void main() { cout<<"This program checks whether the … | |
I never knew that near and far were reserved until I made a struct for bounding boxes like this: struct boundingBox { float near, far; float left,right; float top,bottom; }; Does anybody know what near and far do, because I got the error that the declaration does not declare anything. … | |
# Source Code # robo.h - http://pastie.org/3698136 main.cpp - http://pastie.org/3698145 functions.cpp - http://pastie.org/3698148 # Glitches # When ever i try to create more than 2 instances of the class Robots the program will compile but crash it is crashing during construction right after the first while loop, i would think … | |
Hi all, I have implemented overloaded function for operator new. In this function I have not allocated any memory still while exiting from program it is getting crashed. Code is as below: class A { public: int a; int b; A() { cout<<"Inside A::A()"<<endl; } void* operator new(size_t s) { … | |
Hey guys, i am a beginner in c++ and i don't know what's wrong with my code. i'dont get any errors, but when i run the programme the following: "... Line: 251 Expression: vector iterators incompatible ..." I think there is a problem with "b.getmark()" and "b.getcoursename()" but i don't … | |
Hello, I'm fairly new to C++, and i would like to know how to make a program that uses IO stream? like, i want it to have settings feature where the user would enter thier info on a form, and it saves as a .txt or another format file, and … | |
I have a header file. #include <iostream> class coinReturn { public: coinReturn(); coinReturn(int quarters, int dimes, int nickels, int pennies); void setChange(int quarters, int dimes, int nickels, int pennies); void getChange(int& quarters, int& dimes, int& nickels, int& pennies); void print (); private: int countQuarters; int countDimes; int countNickels; int countPennies; … | |
what is the pseudocode for printing prime numbers to a given value n | |
Hey guys, I don't know where to get started in this. I pretty much only have the header file and I don't even know if that is correct. I don't know what the question is asking other than it is asking me to open up a text file. Any suggestions? … | |
How can I parse through a large file in a fast and efficient way? | |
Hey everyone. I just finished a cross product calculator program for the fun of it trying to test stuff outside of my rage of knowledge. I tried a couple new things like strings and cin.fail() so if someone would read over it and tell me what I did right/wrong that … | |
I have to create a game, in which the computer chooses randomly a word out of 5 and randomizes its characters, so that the user has to guess the word. He can also get a hint of the computer. I have started the code, but dont know how to continue: … | |
Hi, I've been searching around about DLLs and I can't get what they actually are. Why do we need .cpp, .h and .dll file and how do we link it using CodeBlocks? I used tutorials to create DLL files, and it was successful, they contained 2 functions, but linking is … | |
// Planet.h "Header file" #include <string> using namespace std; class Planet { public: // Constructors Planet(); // Post: your weight and the Planet's weight set to Earth. Planet(string); // Takes in string value and sets it to planet name, or defaults to earth if not valid float PlanetWt(float) const; //observer, … | |
Hey! I have one problem with sorting matrix. So i want to sort the first row in matrix alphabetically and than copy all the values of other rows to matching char. Example: R E D b g s a v g a a sorting first row, and copy other char … |
The End.