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

by kevo
Need some help with a prime number loop
 
#include <iostream> using namespace std; int main() { int k; int prime = 2; int count = 0; int i = 1; while(prime<100) { while(i<=prime...
[4 replies] Last: your code, indented #include <iostream> using namespace std; int m... (by ne555)
by Ozzy69
the STL algorithms use iterators, not containers, why?
 
Help me, please
[3 replies] Last: You can easily wrap algorithms to take just a container. #include <io... (by naraku9333)
Can someone help me understand the concept of the DXGI_FORMAT enumeration?
 
I am trying to make my first direct x game but I am having some difficulty trying to understand some of the concepts. The concept that is really getting to me i...
[1 reply] : "Four-component" means that each pixel has four components, "component... (by helios)
int __cdecl main(int argc, char **argv)
 
This is the main function declaration for a Winsock Client Source Code. Can someone explain what the __cdecl is? And why are there two *'s in front of argv in...
[3 replies] Last: I see. Crossed out the incorrect information. (by Zhuge)
compilation error
 
Hello! Can anyone explain me why if I make the function get_fName a const function, it returns _fName only with the casting (char*)? Without casting, it not com...
[2 replies] Last: That question was not formulated as well. This is another question: ... (by leonid1990)
How do I work with pointers here?
 
I'm trying to change my pointer to point to the address of x. So that it would work like it would if that commented piece was used. #include <iostream> ...
[12 replies] Last: Alright, I understand it now. Thanks for the help. (by cppnoob25)
Tracing table question
 
Hello there. I am completely lost at what this question is asking. I appreciate any help hand trace the following & show the value of n & the output int n...
[1 reply] : you should go step by step and get the output and the value of n 1. ... (by Gamer2015)
IRC Bot troubles
 
Ok, I have a new problem for you all. This time it has to do with IRC's and networking. I am trying to make an IRC bot in C++ using SDL_NET. So far I can get co...
[1 reply] : Ok, I got it working. All commands needed \r\n in front of them. For e... (by Jacob16682)
by mliw
Jumping into C++ - 12 Days of Christmas problem
 
This is the question: Write a program that outputs the results of the 12 days of Christmas using switch-case (hint: you might want to take advantage of fall-...
[2 replies] Last: hint: you might want to take advantage of fall-through cases I think... (by dhayden)
by jmlong
Why I can not get right number?
 
Hi, I have raw data in a binary file. I try to count how many Byte meets this condition: its value equals 128, and the Byte after it 255 bytes equals 255. The ...
[4 replies] Last: Thanks. I check other data file. It works. The previous one may be bro... (by jmlong)
need to solution of this two program
 
1) Write a C++ program that reads an integer N from the keyboard. Then declare two character arrays called CA and SM of size N. then your program will keep rea...
[1 reply] : Please note, that this is not a homework site. We won't do your homewo... (by MiiNiPaa)
SAT Collision Issue
 
Ok, I am kinda new here so hi guys!. I am having a bit of an issue with a collision detection system I am trying to get working that uses the Separating Axis Th...
[10 replies] Last: Time to apply it to my awesome game now that I got it working. (by Jacob16682)
Code::Blocks problem with SDL
 
Ok so I have set up code blocks for SDL in my flash drive and it is working perfectly. Now i've created new project in destkop folder and set it up the same way...
[no replies]
by faazm
Key Press Event
 
I want key press event to be triggered when prompt to press any key in c++. I did not find any helpful solution to this. Yet I tried "std::cin.get()". Also I wa...
[2 replies] Last: Thanks for reply! I have gone through ncurses but didn't found helpful... (by faazm)
weird class ctor
 
#include <bits/stdc++.h> using namespace std; class C { public: int ft, sd; C(int foo,int bar): ft(foo), sd(bar) { cout << "ctor 1\n"; } C(const...
[3 replies] Last: It is not a good idea for constructor to have side effects which can m... (by MiiNiPaa)
Problem with if statement.
 
hello friends... have a look of this code. fstream fout(file,ios::ate|ios::out|ios::in); cout<<"\n"<<sizeoffile()<<"\n"; if(sizeoffile() == 0) { cout<<"...
[16 replies] Last: Please post your current full code. Have you tried running it in a deb... (by dhayden)
July 2015 Pages: 1... 131415
  Archived months: [jun2015] [aug2015]

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