Beginners - October 2012 (Page 15)

Word guessing program and C strings.
 
#include <iostream> using namespace std; int main() { char word ; char letter; char newword ; char wrong ; char correct ; int nl = 0; ...
[4 replies] Last: I would take a look at my sample code and adopt some of the simpler te... (by IceThatJaw)
Trouble with Pointers and Classes
 
Hey all. I'm new here and could use some help. I'm having a hard time finding out what's wrong with my code. It's the first time I've had to deal with pointers ...
[2 replies] Last: Bumped (by Rodekki)
by kox
Converting 3 ints to string
 
I have to compare 3 integers to string that has 3 chars. I want to create a simple program that searches for 3-digit "password". Here's the code: //25.10.12 #i...
[15 replies] Last: Just don't laugh xd I still don't get it. I put these at the beginning... (by kox)
Working on a basic "Conversation" AI
 
//HAL ENGINE 0.0.0.0.1 #include "stdafx.h" #include <iostream> using namespace std; int main() { int SCENARIO1; int SCENARIO2; int SCENARIO3; ...
[4 replies] Last: 1) If you want to input a name instead of a number, use a string, not... (by AbstractionAnon)
Provide solution
 
Hello freinds, Please provide the solution to the following two programs: 1.Design a class STR to overload + and < operator to join two strings and to compa...
[1 reply] : Why don't you? (by ResidentBiscuit)
output of the program
 
can anyone please explain me the output of the program #include<stdio.h> main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s...
[4 replies] Last: The postfix operator has the highest priority among others operators i... (by vlad from moscow)
partially initialized array
 
#include<stdio.h> main() { int a = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a ; *q=***a; printf("%d----%d",*p,*q); getchar(); } i am getting th...
[2 replies] Last: but what's wrong in what i have said that if an array is initialized p... (by geekocoder)
by Greye
Short question
 
Hey everyone, I have a short question. I'm trying to learn some basics, so I picked up a book and started reading :D I came to the chapter about nesting, and f...
[1 reply] : It sets accu to 0 at the start. And if the first value you type in is... (by Moeljbcp)
Multiple definitions
 
I don't understand why I'm getting this error, as I've only defined it once, even if I remove the function prototype the error remains. ... namespace zyx...
[19 replies] Last: Ah I see! I didn't realise I was creating it outside of the namespace,... (by Zephilinox)
What does [ ] do?
 
Hey everyone. I was looking through some code and came across some where they had numbers and letters in [ ]. I tried looking around over the internet of what t...
[2 replies] Last: Thank you, I appreciate it. (by VincentVindicated)
## operator
 
i compiled the following code and got my output as 100.I am not able to understand the logic behind this...basically the meaning of ## operator...please help me...
[2 replies] Last: ## is a preprocessor directive. It pastes two tokens together. So f( ... (by vlad from moscow)
Help with while loop please
 
Hi, I have to make a little program, well it's sort of a game of chance that generates random numbers and you have to guess the number...well I need to nest a w...
[9 replies] Last: ok in the code if(play!='y'); printf_s("thanks for playing"); r... (by gsizzle10)
friend function!!!!Logical pr0blem
 
i have written a friend function in c++ with classes but it is not compiling.The main problem is with constructor defination as shown by the compiler i have c...
[3 replies] Last: 0'thnxs guyz !!!!! (by biLmLik)
Debugging A C++ Program
 
Hi,I have this assignment for my programming class and I am having trouble with it. It is intended to be a program that inputs monthly sales data and displays t...
[7 replies] Last: If you don't have a debugger, the addition of a few cout statements wi... (by Chervil)
:: operator
 
In for example this code: void Sys_ShowWindow( bool show ) { ::ShowWindow( win32.hWnd, show ? SW_SHOW : SW_HIDE ); } What do the two colons before Sh...
[2 replies] Last: Thanks! (by Fransje)
reading file, vector magnitude, angles
 
so i have to write a program that reads x and y coordinates from a file, calculates vector lengths and positive radian and degree angles, and writes the data to...
[10 replies] Last: thats okay, its much better if you write your own code :) Hopefully mi... (by martianxx)
by smrt
push_back not accepting input
 
Hello, all. I am in a beginning CS class at my University and my assignment is to write a program that takes a series of restaurants and narrows them down to...
[6 replies] Last: Yes, use a loop. Line 17 there is evil. You aren't allowed to do that,... (by Duthomhas)
tutorials that explain things like you are a beginner tend to end at polymorphism...what would the next steps be?
 
am i too far ahead of the learning curve or am not trying to understand hard enough im not that comfortable with pointers and references and still havnt gra...
[no replies]
this in constructor | error
 
Hi all, I have this code: class Numbers { private: int a; int b; public: Numbers( int a, int b ) : this->a( a ), this...
[1 reply] : You shall use either qualified (for hidden base classes) or unqualifie... (by vlad from moscow)
Question about executing a step within a loop
 
Hi guys. I'm trying to make a program where if more values were added then initially declared in then I want to make it the case that the last value is ignored...
[1 reply] : You could put the values into a vector with push_back , then you have... (by TheIdeasMan)
October 2012 Pages: 1... 1314151617... 84
  Archived months: [sep2012] [nov2012]

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