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

If statement not working right
 
Ok, I have a weird bug. For one of the If statements,it will still go through even if it shouldn't. if(var == 0) [var = 0] OKAY! if(var == 0) [var = 2] ...w...
[1 reply] : Firstly, you're missing a semicolon on both. The first if does nothing... (by shadowmouse)
Out of memory error'TIC TAC TOE GAME'
 
Actually, I am making a simple 'TIC TAC TOE' game in c++ language... with simple looping and if-else statement... The problem is that My program is going to b...
[8 replies] Last: Turbo C++ on w8.1 x64? Too much sadism in this world (by S G H)
by kduino
casting bytes to chars etc
 
Hi there, thank you very much for your time and thank you, that you keep up this forum. As I am programming sketches for Arduino (the user name gives a hint) I...
[no replies]
Please explain this program.
 
#include<iostream.h> #include<conio.h> class add { int num1,num2,sum; public: add() { cout<<"\n Constructor without parameters"; num1='\0'; num2='\0';...
[1 reply] : You've been asked before: Please use code tags when posting code. If... (by MikeyBoy)
Recursive binary search tree insert function
 
So I am trying to implement a recursive version of the insert function and this is my current attempt. I can get it to change the data stored in the root node b...
[2 replies] Last: So I did what you told me and then modified the recursive calls but I ... (by cppnoob25)
SDL OpenGL terrain bug
 
Hello! So I've been trying to port my java game engine to c++ and I tried to make terrain generation. My code works well in java but in c++ it generates a pl...
[5 replies] Last: The "*1" had to be "-1" (by KriszDev)
Template Class problems.
 
Hello everyone! I've practicing for an exam today and I have encountered a few problems that I couldn't solve on my own. Here is what I am meant to do, so yo...
[6 replies] Last: Nevermind. I have fixed 1) and 2) and I'm working on 5), I think it wi... (by klimentije33)
Cannot execute command in my own shell
 
while(true){ cout<<"Shell$ "; getline(cin,cmd); strcpy(argv , cmd.c_str()); if(cmd=="exit" ){ exi...
[17 replies] Last: how about this string prog="./hello"; execlp(prog, prog, (char*)NULL... (by csstudent123)
deleting unprocessed chars on stdin
 
Using Visual C++, I created this this function: int GetNum() { char buffer ; size_t size_read; int i = 0; printf("Enter a value (number) for the ...
[3 replies] Last: OK, none of your responses enabled me to get _cgets_s to work. Thanks... (by dschwart)
Can someone help me completely understand the concept behind linked lists?
 
I already went to the tutorials and i have tried using google but i still don't completely understand the concept behind linked list... from what I understan...
[4 replies] Last: By the way: it's a singly linked list. Doubly linked lists are more c... (by coder777)
c++ s/w
 
I want to make a graphics player for children. But I am unable to visualize all the part of the s/w. for example; 1st part (coding) circle 50,0,0,blue-...
[no replies]
Clear area in Mine Sweeper
 
I'm working on improving a 'Mine Sweeper' program I wrote, but am having trouble clearing the whole area that is surrounded by mines. In my original game, I jus...
[2 replies] Last: @cire Thanks. This will make my 'Mine sweeper' game a lot easier to p... (by whitenite1)
Generalizing a factory class
 
Solved
[no replies]
Two Different Values at one Memory Address.
 
Ok so I've decided to fiddle around and learn about the memory addresses. So I wrote a very simple "guess this number" program. And I wrote another program to...
[19 replies] Last: I'm on Windows so each time I run the program, the memory address is ... (by Duthomhas)
Error
 
Hello, Getting error when trying to compile my set bits program: #include <stdio.h> #define mask (1<<n) - 1 #define mask2 ((1<<n) - 1) << p unsigned se...
[2 replies] Last: Line 27: You have unbalanced parenthesis. (by AbstractionAnon)
Pls explain how this working??
 
#include<iostream.h> #include<conio.h> #include<string.h> class strings { char s ; public: strings() { s ='\0'; } strings(char *c) { strcpy(s,c);...
[6 replies] Last: can you post using code tags please? And also take note of what new sa... (by mutexe)
School Assignment
 
First to begin. I am not a professional programmer by any swing of any imagination. I hate computers and they frighten me. I'm trying to fix that. So anyway I'm...
[12 replies] Last: @rcl4: I don't blame you: I was being goofy. I meant to lighten-up th... (by koothkeeper)
by anhnha
Multi-threading functions
 
I am planing to learn and write some functions using multi-threading technique in C++. Is there any conditions for a function to be converted from single thread...
[1 reply] : cin/cout are not functions. They are global variables. If variables ar... (by coder777)
by LauraM
Priority queue using linked list and heap
 
Hi! I have to implement the following problem using as ADT a priority queue and two DS: linked list and heap. ,,Consider n balloons that are moving vertically...
[no replies]
Reading from a text file and printing the names in alphabetical order using vectors
 
Hi, i'm having a problem on how to print the names in alphabetical orders using the vector. here's the code.. please help me :( void Record2::view(vector<st...
[3 replies] Last: Don't post the entire code, post the relevant code and use the code-ta... (by Gamer2015)
June 2015 Pages: 1... 13141516
  Archived months: [may2015] [jul2015]

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