Beginners - August 2011

by tkerb1
Beginners Questions
 
I just got into C++ and I wanted to ask some fairly simple questions. 1. #include <iostream> using namespace std; int main() { int name; cout << "What is...
[4 replies] Last: Thanks that really helped! (by tkerb1)
by Stoo
2 the Point
 
Hello again. I`ve installed codeblocks and SFML to the best of my ability and I still would like to be able to plot a simple pixel or point to a screen/bitma...
[2 replies] Last: Have got simple windows open, even run sample code but the simpest I`v... (by Stoo)
Need help with an assignment
 
6 a) Print the even numbers between 3 and 43. b) Print every third letter starting with 'B'. c) Print the numbers 1 to 20 in one column right next to anoth...
[3 replies] Last: Do you know what compiler that you are using? Usually if a signedness... (by closed account 3hM2Nwbp)
while loop not working
 
When the code gets to this line and currentState->nextState does equal STATE_EXIT the loop runs anyways. What would cause this? while( currentState->nextSt...
[3 replies] Last: @Tolga gerekci I'm sorry but this is a bad piece of advice, so bad you... (by joro550)
by wtf
unknown operator
 
got error: could not convert something something yada yada ->integer::number + something unknown operator something something yada yada yada yada to bool at...
[12 replies] Last: I think that the problem is with yada, yada. So if you change it to so... (by ne555)
How to read trailing spaces in a string?
 
Hi, My program below does not count the 3 trailing spaces in " Hi There "; it takes only the first two and the one between Hi and there. Can you please...
[2 replies] Last: To find the number of charecters in a string excluding the white space... (by erpsuresh)
by wtf
Is this code too confusing?
 
class integer{//etc etc etc bool integer::resize(VERY long ns) { if (ns == size) return true && false; if (ns == 0) { ...
[1 reply] : yes. =P Your code is intentionally obfuscated: return true ||... (by Disch)
problem with reading files
 
i'm trying to sort out a file by tokenizing the strings, then after figure out how many tokens are on each line, then after see if each line has a certain objec...
[no replies]
Fastest library for 3d graphics?
 
I'm looking for a graphics library that can have 3d models, but with the minimal amount of coding. Any ideas?
[10 replies] Last: Okay. Thanks for all the help, and thanks for not getting super pissed... (by ziodice)
While Loop Problem
 
Hello, I'm trying to code a simulation of a card game called Acey Ducey where the computer outputs two cards. Then the user chooses to bet money or not. Then, t...
[3 replies] Last: It's not a syntax error to put srand in a loop, so your compiler sho... (by Mathhead200)
Bold text with cout
 
I am looking for a way to create different text styles for my output. I would like to use cout to produce some text that is bold and other text that is not bold...
[5 replies] Last: Yes, I am using xcode. I use g++ to compile. (by vckngs7)
Problem with pcap programmin
 
Hi I want to capture packet with library,for the first step,I have compile this simple code,that I derived from example of tcpdump official site. #include ...
[no replies]
strcpy
 
I have really annoying problem with strcpy. Whenever I use strcpy(blahblah, "blahblah") I get this warning message: warning C4996: 'strcpy': This function o...
[2 replies] Last: warning C4996: 'strcpy': This function or variable may be unsafe. Con... (by Moschops)
Overloading the ++ operator (prefix) help please
 
Hi all For some reason (and I would really like to know exactly what that reason is ;)) my ++ operator overloading via a a friend function does not want to ret...
[5 replies] Last: Thanks Athar, I see what you mean. In mine the lack of the & after Pla... (by georgelappies)
vector problem
 
hi guys ok so i have a vector called health and it has 10 elements, each element is equal to 100. the way the program works is if the user type 'd' it will red...
[5 replies] Last: std::vector<int> health(10, tower_health); // construct 10 elements w... (by closed account DSLq5Di1)
by Chathu
new int ???
 
What does the new keyword mean? #include <iostream> using namespace std; class CRectangle { int *width, *height; public: CRectangle (int,in...
[5 replies] Last: Thanks a lot :) (by Chathu)
Find a specific element in a set
 
I have a set<int> s and I want to find the greatest number in the set that is smaller than an int x. So, this is my way (kind of): set<int>::iterator it=(s.i...
[5 replies] Last: Thanks. This site is really great for a beginner like me :D (by hackinghorn)
How to center an output?
 
How can I be able to create a program when the user inputs n=4 the output should be like this * ** *** ****
[7 replies] Last: * (n is 1 or 0*2 + 1, pad is 3 or 4 - 1 - 0) *** (n is 3 o... (by Mathhead200)
by sf123
Program has stopped working?
 
Hi! Do you have any idea why my program stops from working? Any causes for it to stop working?
[13 replies] Last: Just to help out, I thought I'd finish that loop for you with an exit ... (by Stewbond)
Delete repeats from array
 
I'm working through Walt Savitch's Absolute C++ and am doing Programming Project 2 from Chapter 5 - "Arrays". The task is detailed below, but basically it is...
[no replies]
August 2011 Pages: 123... 39
  Archived months: [jul2011] [sep2011]

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