General C++ Programming - June 2012 (Page 10)

Wrong file output...
 
Then i run my program i get one last word out of all input words. But I need to get all with newlines. Help please. For ex. INPUT: print *hello* ...
[1 reply] : The problem is of course on line 31. You keep overwriting the input. C... (by coder777)
by stbb24
Big O notation O(n)
 
Can anyone explain the Big O(n) in finding the complexity of an algorithm? Thanks in advance
[5 replies] Last: Ok thanks for your replies :) (by stbb24)
Adpating on old c++ book
 
I'm adapting code from Scott Robert Ladd's "C++ Templates and Tools". It's a very old book, and the code looks different from what I'm used to. Here's an ex...
[1 reply] : If it's an old book, don't use it. I'm not sure what standard it's bas... (by closed account zb0S216C)
Using the "using" keyword with classes
 
Hi, I am having a problem with excessive scope qualifiers (::) such as this: std::vector<Cube::Face> vecFaces = {Cube::f_RIGHT, Cube::f_TOP, Cube::f_RIGH...
[10 replies] Last: You cannot use the scope resolution operator on a enumeration. This is... (by closed account zb0S216C)
A non-static member reference must be made relative to a specific object
 
#include <iostream> #include <Windows.h> using namespace std; class player; void name(player); int main(){ }; void name(player){ cout<<"What is your name...
[8 replies] Last: Remove these lines: class player; void name(player p); Also in the ... (by S G H)
Hi
 
Hi All. I am from Georgia, Unfortunately I don't know English well. sorry for bad english. I have one question about c++ programming. how can I create interface...
[8 replies] Last: thank you all for supporting :) (by Datolius)
stdafx.h
 
i am working on a c++ program so i can load an image it compiles except for one error coming up as unable to open include <stdafx.h> header file, i am using vi...
[1 reply] : It should never be: #include <stdafx.h> It should be: #include "std... (by kbw)
by revin
Project Euler
 
http://projecteuler.net/problem
[8 replies] Last: Wow...how did I never know about this site?? Very fun problems! So far... (by rollie)
Simple encryption program
 
Write a simple encryption program using string functions which apply the substitution method. Explain the program by parts. Here is the given substitution table...
[3 replies] Last: Here's a C++ translation: #include <iostream> #include <map> #includ... (by Cubbi)
x64 ports ...
 
I used to work for a medical company that ported an application to x64. In one of the meetings held, there was a discussion of whether to change in general ...
[8 replies] Last: If you feel like it's a good opportunity to enforce a company-wide cod... (by Cubbi)
by dancks
trouble with linked list
 
So, I'm using allegro game programming library. Before I move on to bigger and better things I wnat to get a handle on pointers. Specifically with things like s...
[1 reply] : for the newbies who are curious I figured it out on my own. I posted t... (by dancks)
by x1222
Calculating run time with O(nlog2n)
 
If the run time for the process is 0.4s for when n = 1000, what's the runtime for n = 4000; Should it be 4000log2(4000) / 1000log2(1000) * 0.4s? Or is i...
[no replies]
Makefile Libraries
 
# Link command: ASCII_RPG: main.o get_res.o loadalleg.o keyboardinput.o c++ main.o get_res.o loadalleg.o keyboardinput.o -o ASCII_RPG # Compilat...
[no replies]
Delete operator clarify
 
I thought when delete operator is used, the pointer gives back this memory to the heap, so after I delete: p_to_num, why does dereferencing it still output: 8...
[11 replies] Last: I'll look into it, I tried typing in Windows cmd: g++ -v and it gives ... (by closed account 4ET0pfjN)
Arrays and pointers
 
Hello guys, i have a problem. I have to make function that multiplies two matrices. One is array with 8 values and the other one is with size (8x3). I am stuc...
[1 reply] : Please edit your post, or reply, with source code so that we see what ... (by Catfish2)
emptying BST
 
Why doesn't root in main point to NULL but some other random address? void destroy_tree (bt_node* node) { if ( node != NULL ) { destroy_tree( node->le...
[7 replies] Last: Finally I figured it out, I was mixing up left->left @ each level of r... (by closed account 4ET0pfjN)
Colour
 
Hi, im wondering how to make randomly type letters. Like this for a example ---------------------------------------------------------------------- int A; A...
[2 replies] Last: int A; A = 1; while (A == 1) You can change that into: while(1) ... (by S G H)
printing words around
 
hey everyone, I stuck on this program which I trying to make a word print out but it looks like its moving. like example the words you see below the TV news sc...
[no replies]
Composite+Decorator in C++
 
Hi everybody, the GoF book and many places in the internet suggest the pattern Composite cam be often used with the pattern Decorator. This seems quite a nat...
[no replies]
by Hasala
Calling a function for each second
 
In my program I want to call a function for each second. Once the function has been called it should be called again after an exact second. Like this I want to ...
[2 replies] Last: If you don't have c++11: #include <ctime> using namespace std; int ... (by viliml)
June 2012 Pages: 1... 89101112... 33
  Archived months: [may2012] [jul2012]

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