Beginners - June 2013 (Page 22)

Socket tutorial
 
Can anyone suggest a good socket tutorial with no prior experience needed?
[5 replies] Last: boost.asio tutorials don't require C http://www.boost.org/doc/libs/re... (by Cubbi)
Random Permutations
 
I am at a loss. I have gotten some answers and I have tried looking it up but I cannot find exactly what I want to do. If someone has a link to share, that woul...
[2 replies] Last: Well, it didn't help me write any code, but I can see why you linked i... (by kyiro37)
The First 50 Primes
 
Hello! I was reading a book about C++-programming and encountered a rather difficult exercise, it's in Swedish so I'll have to translate it for you: "To sho...
[9 replies] Last: "Why is there a multiplication sign..." That is because it is an indir... (by Daleth)
Array Merging Problem in MergeSort
 
Write your question here. #include <iostream> #include<cstdlib> using namespace std; void mergearray(int *a, int lo, int mid, int hi) { int i...
[1 reply] : Because you would be accessing `b' out of bounds. The valid index for ... (by ne555)
unusual function definition
 
I ran into the following definition of a function that looked rather unusual to me. Can somebody explain the rules of the definition or/and provide a link where...
[6 replies] Last: Same way you initialize them when you declare objects. struct A{ ... (by Daleth)
Headers and Include
 
I read the "Headers and Includes" article and wanted to try it out, but my compiler gives me an error, and I have no idea why. I use Code::Blocks and the GNU GC...
[8 replies] Last: Thank you all very much (especially Disch). Works like a charm now. =... (by Roundthecorner)
Function Object Template
 
I wrote a function object template to practice working with templates and included a function template. The function template is, however, causing me trouble. ...
[2 replies] Last: Yes, I see it now and it makes perfect sense. I thought the third argu... (by R10111001)
implicit casting?
 
I am just making sure I understand the difference between the two codes correctly. I am creating two instances of class CRectangle but working with them as if ...
[1 reply] : rect is an object of type CPolygon as it was defined by your. *(new Cr... (by vlad from moscow)
Need help recording data as a program runs
 
I'm working on a simulation that runs over multiple 'simulated' days, and need to figure out how to record data from specific days as the program runs through. ...
[no replies]
how to keep the cmd prompt open
 
i want it to display my inventory and stay there if i select 'y' when it asks me to instead of immediately closing after a split second. how do i accomplish thi...
[2 replies] Last: I would recommend using std::cout << "Press ENTER to continue..."; ... (by closed account 3qX21hU5)
by SmOgER
how to assign characters with empty spaces into single string
 
If i have potatoe onion tomatoe yeah somewhere in txt and I know that it's total of 26 characters, how do I store it to a single simple string with no wise...
[11 replies] Last: Managed to fix this by ending line before reading chars with in.ignor... (by SmOgER)
__TIME__ !change value
 
Hello I want to add time that change every 1 second to my simple c++ game I am working on now, but it seems that once __TIME__ is used, it will never change? ...
[1 reply] : __TIME__ is a string literal in the form "hh:mm:ss" containing the tim... (by AbstractionAnon)
No Value-command?
 
Hello! I was just wondering if there is a command that tests if a variable has a value or not. As an example: int x = 5; while(x has a value){ d...
[8 replies] Last: If you find the question answered, you should mark the thread as solve... (by Marcos Modenesi)
program suddenly stops working
 
hello. i wrote this inventory practice code and everytime i compile+run it, it says "inventory practice.exe has stopped working" and then closes, i cant figure ...
[1 reply] : What is the initial value of numItems ? (by Chervil)
swapping parts of an array around
 
What would a good way to swap artistfirstname with artistlastname in array = {{ "artistfirstname artistlastname 'song name'",}, ..........} the array will be ...
[8 replies] Last: @Cubbi What I'm trying to lead to is that if the program operates in... (by vlad from moscow)
[SOLVED] Leaking memory
 
Consider: int main() { for (int i = 0; i < 100; ++i){ int* ptr = new int; } return 0; } My question is: What happens with memor...
[4 replies] Last: Thank you all for your answers. Very helpfull. (by Marcos Modenesi)
by piczim
Error messages
 
I have two error messages in the code below that I have no idea what they mean. Knot knowing what they mean means that I am unable to fix them. The errors a...
[1 reply] : The messages mean what they say. Here switch(inputamount) should be... (by Chervil)
Weird and Unwanted Error!
 
Hello again! I'm writing a "Rock, Paper, Scissors"-program, and it is going pretty well, except for one little problem. Whenever the user enters that it does...
[14 replies] Last: No. I think I read somewhere that it is not necessary, but I still alw... (by GoranGaming)
lvalue compile error
 
Why am I getting the compiler error below? typedef uint8_t byte; setBit(char *ch, int bitnum, bool set) { uint8_t mask = 1 << bitnum; if ( ...
[2 replies] Last: I originally had *ch |= mask; and the compiler complained about an i... (by SeeCwriter)
Problem with for loop in member function
 
I am trying to get a handle on class templates and I wrote a simple template to create objects able to handle any data type. All the objects do is store data in...
[2 replies] Last: Thank you for your quick reply, you are completely right. I can't beli... (by R10111001)
June 2013 Pages: 1... 2021222324... 49
  Archived months: [may2013] [jul2013]

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