Beginners - December 2008 (Page 4)

21 card trick
 
Hi, I am trying to write a program which mimics a card trick that I saw once. The trick starts out by having a person select 1 card from 21 random cards, loo...
[3 replies] Last: You're probably going to want a different algorithm altogether. Try th... (by jeffbmartinez)
using classes
 
Need help please. I'm new to classes and I have a program due. I'm reading from a file and using the following functions: readdata() Two parameters, the array ...
[10 replies] Last: Hi jeffbmartinez I know you guys are not getting paid for this. As ... (by tyky9808)
by simsim
whey this code is not correct
 
How are you all group of this forum I am from KSA , I am beginner in C++ language Dear Members I wrote C++ program to convert binary number to decima...
[1 reply] : bin holds a char, so '1' won't be 1 but something like 49 (by Bazzy)
sizeof a boolean variable ???
 
what is the sizeof boolean variable does it actually use only one bit if not why not??? can anybody explain
[7 replies] Last: http://www.cplusplus.com/reference/stl/vector/ See the bottom of the ... (by helios)
by gulu
how to store a 1 dimensional array in a 2D array?
 
I have problems with storing a 1D array (size 16) into a 2D array (4 by 4) what i have come up with is for(int i=0; i<3; i++)//since it is a 4 by 4 matrix ...
[7 replies] Last: If you are translating a 1D array into a 2D array, you only need 1 for... (by seymore15074)
by Gibby
Assignment due for Campus
 
Hello everyone. My name is Chris and I have a project due for my C++ class, which is ending in 2 weeks. Uptil now, I've been able to complete every project w...
[12 replies] Last: Here are some comments on what you have so far: 1. I don't see a ne... (by seymore15074)
by naab
Pssing arguments in to main.
 
How does this help..is there any use this syantax int main(int x, char *y )
[1 reply] : It was explained in this post: http://www.cplusplus.com/forum/beginner... (by Bazzy)
Loop Problems
 
Can Someone Show Me An Example Script Of How To Make A Macro: It Needs To Be Able To Press A Key every 2 seconds. its just one key, the space bar. and how do i ...
[3 replies] Last: Hm. I guess I misunderstood you when you said [The macro] Needs To B... (by helios)
by Vector
C++ Strings
 
Running into a problem with strings. My code will only work if the array i have is intialized.. #include <string> #include <iostream> int main() { ...
[7 replies] Last: No, cmath is the C++ header...math.h is the C header...hence once one ... (by firedraco)
Macros with undefined number of parameters
 
Hi, it's possible to write macros that accept an undefined number of parameters?
[2 replies] Last: PERFECT!! Thanks (by cppuser7)
by wachtn
Tips and tricks and other WTFs Idk about
 
Im new to C++. I have been working on my blackjack program but kinda stuck on how to put it all together. While I sort thru the mess that is (was) my brain,...
[5 replies] Last: - Use clear names for classes, functions and variables (maybe you'll ... (by firedraco)
by wachtn
Random Problem
 
Hopefully the last stupid question I post for this program. I hope I havent bugged any one yet. Im having some mystery trouble with my RNG. Do you see any...
[3 replies] Last: Well, srand() is the seed. time(NULL) returns the number of seconds ... (by Scipio)
by II15X
Produce a .txt file
 
Exactly how would I produce a .txt file of everything my program showed? But I want it to print out everything, even if I type something in.... Any suggestions?...
[5 replies] Last: It's always possible to do this from the command line: program >outp... (by helios)
Implementing Constructor of Generic Class
 
Hi, I'm trying to implement the code for the constructor of the following class, outside it: template <class T> class Matrix { int w, h; T* m; ...
[4 replies] Last: Indeed, I was declaring the class at a header file and trying to imple... (by kunigami)
hh:mm how to divide it and put it into different arrays ??
 
Let's say, I've 2:30 stored in time array which is of type "char". I want to divide the char array into hour and min (in the above case hour will get assigne...
[1 reply] : Sounds like a homework assigment, but I'll give one hint: have you not... (by Scipio)
by wachtn
switch case vs if statement
 
Which is best to use when? Is a switch case statement just a limited version of the if statement?
[2 replies] Last: But, keep in mind that if has a nesting limit, after which the compil... (by DarkFire21)
by OGNNEC
C++ Visual Studio user defined functions
 
I would like to use some functions that I create directly without copying the function code each time. I have created and used the functions in line. What libra...
[1 reply] : I hope I answer your question correctly. I think you do it the same wa... (by wachtn)
by wachtn
Error with class functions
 
When trying to compile my program I get this error: In function `void setCardSuit()': 5 `cardSuit' undeclared (first use this function) I get the sam...
[2 replies] Last: I would like to go ahead and claim credit for the solution anyway. heh... (by LacViet)
About borland c++..
 
I use Borland C++ version 5.02....... In the text editor i find a line separating the page in two...... can anyone tell me what could its use could be........
[4 replies] Last: Thanks ....I'll follow..... (by Harlequin)
Why this code cant work?
 
#include <winsock2.h> #include <ws2tcpip.h> #include <iostream> #include <stdio.h> #include <conio.h> using namespace std; #define DEFAULT_BUFLEN 2 ...
[2 replies] Last: Code without the tags is really ugly. I assume your referring to th... (by Umz)
December 2008 Pages: 123456... 17
  Archived months: [nov2008] [jan2009]

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