General C++ Programming - February 2014 (Page 25)

atoi function
 
I am looking at an implemntation of the atoi function below: int atoi(char s ) { int i, n; n = 0; for (i = 0; s >= '0' && s <=...
[4 replies] Last: I see, for each iteration, we increase by power of 10, since we are us... (by johnmerlino)
Need help with using a loop
 
I have been given to do a simple ATM project which is containing of getting a number of notes in the ATM (100, 500, 1000). Get the withdrawal of money and show ...
[1 reply] : Use a while(true) loop with a break statement. #include <stdio.h> ... (by zsteve)
2D Vector using std::vector
 
Hi, I am trying to make a 5x3 2D-vector of integers, then set its i-capacity to be 5 and j-capacity to be 3, i.e: vec2D i = 1,2,3,4,5 j = 1,2,3 and the...
[8 replies] Last: Line 74 reserves capacity in the vector. It does not place any obje... (by cire)
Help
 
Im trying to figure out how to randomly insert certain numbers into a linked list with 10 nodes. Meaning I want to put for example numbers 1 5 10 15 20 25 30 35...
[1 reply] : for the list, use std::list. to insert into random locations, my idea ... (by zsteve)
by venros
tic-tac-toe - dont know whats wrong
 
Hi guys, Im programming tic tac toe but the board is not showing numbers, and it is simply stating the winner without any input: (the win conditions are not ...
[6 replies] Last: [quote=venros]How would you recommend I use my char board array? I del... (by MikeyBoy)
Moving big objects
 
Normally when I work with big objects, I like to use pointers just to ensure that I'm not copying data by accident (when I don't specify a copy constructor). ...
[11 replies] Last: > @JLBorges: I see RVO, no move assignment. And how much slower do yo... (by JLBorges)
accessing/assigning values of a 5 dimensional array
 
I'm okay with 2-dimensional arrays, but when I get to 3 or more, I can't seem to wrap my head around how to assign and/or pull values from specific parts. To...
[6 replies] Last: Okay, I understand. I did use q .Tasks.resize(5); , just forgot to m... (by xwielder)
help
 
i am trying to write a program using code block the question is this; write a program to compute annual tax of a staff, for the first month to the third month...
[1 reply] : If you want help then provide what you have. If we do it for you we wo... (by giblit)
Reading in a graph
 
So my prof gave me a problem in which I need to do some work with graphs. Now I've built an algorithm that should solve the problem, but I don't know how to rea...
[no replies]
by gudeh
Struct of ints via socket
 
Hey there, I have some paper work to do about a game I should be able to play with my class mates. We should be able to send and recive a struct concerning abou...
[3 replies] Last: well, all this time to find out the problem was a missing ( ... ) at t... (by gudeh)
by dowi
Command line and waiting for a connection (Socket)
 
Hello everyone, I am designing a server program in C++ and now that everything works for the clients, I would like to implement a command line. The code waits...
[5 replies] Last: The server itself never* exposes itself to the command-line like that.... (by Duthomhas)
Having an issue with headers
 
I'm a newbie in c + +, but I have experience doing simple programs, this is the first time I'm using headers because the program is going to be much bigger than...
[2 replies] Last: Texture has no member gRenderer. And what it means, is that it has a... (by ElHex21)
new [] syntax I've never seen for zeroing out memory
 
This works to allocate a new int and initialize it to 5 ... #include <cstdio> int main() { int* pInt = new int(5); printf("pInt = %d\n",pInt ); ...
[4 replies] Last: Thanks guys for the info. I'm more a C coder than a C++ one, and just... (by freddie1)
A nicer way to avoid pointers
 
I have this function: Node Device::ToXML() { ... } void Node::AppendChild( Node& n ) { ... } Node Calibrator::ToXML() { Node e; e.CreateElement( CALIBRAT...
[no replies]
by oal
integrating oencv with netbean c++ platform
 
Is there anyone that can help me out on this? I imported an existing project of cmake files of c++ platform into into net bean platform.I want to integrate an a...
[no replies]
double to float conversion error
 
float w = 0.80; this gives an error: warning C4305: 'initializing' : truncation from 'double' to 'float'. please tell me about this.
[1 reply] : That's not an error, that's a warning. Warnings don't stop compilation... (by Vlad Licker)
Having some trouble.
 
Alright im trying to make a choice game on cmd using C++ on codelite. I dont know why its not working (my if statement). if (pick == "yes"); { cout<<"I kn...
[no replies]
expected an expression error
 
if ((floorf(((X -X[k-1] )/X )*1000)/1000)) == 0.055) //chk %error = 0.055 and stop print(k); break; i am writing these codes in visual studi...
[3 replies] Last: thanx giblit, i totally was unaware... thanx jlborges, i ll do that fo... (by praneshiitm)
DirectX or opengl tutorials
 
I can't find any DirectX 11 or opengl tutorials. All tutorials have no source code or not working. Does anyone has good DirectX 11 or opengl tutorials?
[2 replies] Last: this is really good tutorials Thanks Any other tutorials? (by Gameman)
reading the content of a file from command line
 
Hello, i would like to read the content of a text file data.txt (line by line ) directly from the command line using this command: a.exe < data.txt. What cou...
[2 replies] Last: you dont need the '<', you could just type a.exe data.txt read t... (by mutexe)
February 2014 Pages: 1... 2324252627... 33
  Archived months: [jan2014] [mar2014]

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