General C++ Programming - June 2015 (Page 8)

by Djpich
Program Restart Error
 
In this program the do and while statement isn't working...maybe I did it wrong I don't know but all I wanted the do and while to do was restart the program.. H...
[7 replies] Last: @whitenite1 Never mind I found that instead of Char i can just use ... (by Djpich)
Compare objects
 
I have this class that saves the hours : class clockType { private: int h; // hours int m; // minutes int s; // seconds public: void g...
[9 replies] Last: Ok i think i understood, thank you very much !! :) (by chris896)
segmentation fault
 
So I'm practicing templates with data structures and my print function gives me a segmentation fault when I want to print my whole list. #include <iostrea...
[4 replies] Last: Thanks @MiiNiPaa. I completely overlooked that. Even as I read your po... (by cppnoob25)
Still need help fixing it
 
My game still will not stop with the "press any key to continue" sign, if the wrong path is taken. Please show me what the code should look like in order to do ...
[1 reply] : A snippet of your coe with proper formatting: if (weap == 1) { // ... (by MiiNiPaa)
send the modifed file periodically through socket in windows
 
I want to send a file periodically from client to server in C++. say, every 10 seconds. send.txt is the file that i want to send to server through socket sen...
[no replies]
template class help
 
How do I make this work? It works for integers correctly but I don't know what to do when passing a string. I don't want the complete implementation of the list...
[5 replies] Last: Hey coder thanks for that. Changing T to void fixed my whole program a... (by cppnoob25)
Need help with few programms.
 
Hello, I am a student and I am learning programming with internet technologies. Programming was my weakest subject. I have a debt in one of the subjects from la...
[2 replies] Last: Divide and conquer. Separate your task into smaller subtasks and engag... (by MiiNiPaa)
by Optx
My code isnt working (SOLVED)
 
NOW MY CODE IS WORKING. THE PROBLEM WAS: IN C++ pow(10,2) = 99.99999.... and if you say int k= pow(10,2) , then k = 99... so actually, if you want to get 100,10...
[4 replies] Last: @Homberto 2) I know, first I tried that way, but I tried like this bec... (by Optx)
Simulating AI in C++
 
I'm building a MUD in C++. I'm attempting to create something similar to AI but I'm not sure the best way to go about it. Here's a simple example: Warrior ...
[4 replies] Last: If there are several dependencies you might use trees, like: http://w... (by coder777)
Put my game into voids, now turns on and turns off
 
I put my fully working SDL game into voids to make it easier to read, but now it just opens up and then closes down instantly. Here Is My Main.cpp #includ...
[1 reply] : I put my fully working SDL game into voids to make it easier to read,... (by cire)
Float in array
 
Hello I am from poland so please do not use advanced english. I have problem I have something like this: float arg ; for (i=x_p;i<=n;i++) { arg...
[2 replies] Last: I suppose that both i and n are integers. In this case i/n is 0 in e... (by MiiNiPaa)
Code Help
 
I literally just started learning C++ and I've been trying to figure out how to code this. Here is the question: " Vectors are commonly displayed in the f...
[1 reply] : 1) Declare integers x, y and z 2) Promt user to enter them one by one ... (by MiiNiPaa)
How to add sound as a Question?
 
Hello, Newbie here. By using C++, can anyone tell me how to add sound as a question by using following code? #include <iostream> #include <stri...
[3 replies] Last: But how can i create the ufo.wav and etc .wav Well... You could rec... (by andywestken)
functions
 
Can anyone plz help me out with the code of the following question. Thank You ! We want to determine if someone is “rich.” The definition of bein...
[1 reply] : I find your post to be rich. See definition 7a: http://www.merriam-we... (by cire)
Problem with printing
 
Hello, i want to make OS, and i have Kernel,Bootloader, and i have problems with this code: // Print single char void printch(char c){ string memory = (s...
[1 reply] : output is only: somet That makes sense. The number of while loop it... (by closed account D80DSL3A)
to split or not to split that is the question
 
Hi all, I have a doubt on the proper way to design a class (which we'll call MyClass) MyClass has a member function called "run()" However, the definitio...
[4 replies] Last: @doug4 Interesting solution you are suggesting here: cancels the need... (by gLorieul)
how to "go back" in code
 
string command; int main(){ cin >> command; if (command == "exit"){ //code that exits the program } else{ cout << "Unknown command '"<<command<<"' try ...
[4 replies] Last: [quote=LB]You can easily split by spaces: std::string command; while((... (by LB)
by njha98
error : expected ';' before '(' token
 
This is a line of the coding of my program. Please consider the error in the title. The error come in last line. default: cout<<"OOPS!!! Your choice i...
[3 replies] Last: oh, i got it thank u!!!!!! (by njha98)
convert bin to dec stuck in infinite loop
 
So we have to convert dec into bin oct and hex. The bin has to use a while loop and right now mine is in an infinite loop. I thought that doing 'bin++' adds 1...
[2 replies] Last: The other problem is the nasty bit that you're extracting the least si... (by dhayden)
Need help with call functions!
 
So basically my call function doesnt work when it gets to a certain step in my main function. -An error that I get is "No matching function for call to 'powe...
[2 replies] Last: The error message is coming from the line: x = power(x); which o... (by Alrededor)
June 2015 Pages: 1... 678910... 16
  Archived months: [may2015] [jul2015]

This is an archived page. To post a new message, go to the current page.