Beginners - January 2012 (Page 45)

by seth23
Code critique?
 
I made a simple code generator, for no particular reason and is not made to be a perfect pseudo-random number and letter generator, but give some sort of code. ...
[14 replies] Last: The comment on line 15 is confusing, at first I thought it was referri... (by LB)
by Thetr
saving the value
 
#include <iostream> #include <cmath> #include <fstream> #include <math.h> using namespace std; void maing(); void hbuy(); void njob(); void work(); vo...
[3 replies] Last: WOW ! Thanks for helping, imma put your names on "special thanks" list... (by Thetr)
Help with code.
 
I am trying to determine if a number is a multiple of another number. I have the user enter a number, then a second number to check if the second is a multiple ...
[8 replies] Last: if ( (number % multiple) == 0 ) Done. (by closed account zvRX92yv)
by yuxin
return the 2 numbers that will give the minimum
 
Hi all, i'm totally new on C++, that's why i'm posting my question in this forum. I'm elaborating my question as an example. i need to allocate each elements...
[6 replies] Last: eypros, in your example, why would a1 match with a2 ? By what he's to... (by Caprico)
How to Bubble Sort Array using Strncmp?
 
a program that can accept 20 names.Displaying the output with ascending order. Using bubble sort technique combine with strcmp() function to create the output....
[5 replies] Last: Eh, mistakes are how you learn! Glad I could help.. :) (by Caprico)
Count digits (1,3,5) and 2,4,6) in Array
 
Hi there, question is to enter a six-digit number, which is then used to show the sum of the second, fourth and sixth digit & the first, third and fifth ...
[5 replies] Last: Ahh, you still didn't get it completely right... arr still has six ... (by Caprico)
by mithra
char ** to char array
 
Hi i have attached a part of my program below. Here i'm using a function int FileWrite(int fh, char *buf, int len). The buf is a char array. I want to store ...
[3 replies] Last: You must pass the arguments according to your prototype: FileWrite(in... (by eypros)
Strange variable swap problem
 
I have a structure called A, whose constructor looks like this A::A() { N = new vector<neuron*>(INPUT); N_active = new vector<size_t>; } Whenever...
[2 replies] Last: Forcing a full recompile of all source files fixed the problem. weird... (by sohguanh)
by RyanV
I'm Losing Pennies!
 
Hello, I'm trying to make a program that takes an amount of money from the user and returns the optimal way to convert it into change. So, if the user wa...
[7 replies] Last: To represent floating point number in computers is not precise. Use Ma... (by sohguanh)
by Hotice
string::find and using it to control an array
 
I am trying to use string::find and string manipulators to control an array. (What I want to happen in the program is for the computer to look through a string ...
[2 replies] Last: I didn't know much about vectors (until now: I have never been taught ... (by Hotice)
NIM problems, C++ without fear :(
 
Hi, recently i bought a book called C++ without fear, and its great, however i do understand that it has some code errors. when i try to run the NIM exersise fr...
[11 replies] Last: Always welcome... :) (by Caprico)
Help with Code::Blocks
 
So i got CodeBlocks with miniGW and i am reading "Sams Teach Yourself C++" and i am only just in the first hour trying to write the first source code and i know...
[2 replies] Last: ahh thanks so much i didnt even realize it would cause i problem :) (by crazycreator)
Qustion about 'const' when passing parameter
 
I am learning the 'const' when passing parameters in function. I suppose to put 'const' in different places to check what error I might get. Please give me som...
[2 replies] Last: String laterals are constant and are stored on the executable. Its con... (by closed account S6k9GNh0)
Saving What Is Typed While Running to a Text Document
 
Hi. I am fairly new to C++, and I was wondering how I would save a specific part of what is output from the computer to a text file? This is my code: ...
[10 replies] Last: Ok, thanks. (by ethancollins)
map and arrays
 
How can I write a map in c++? From what I've heard arrays aren't really good for super large elements since memory becomes an issue. But again how would "m...
[3 replies] Last: I think "super large elements" refers to a large amount of continuos ... (by histrungalot)
mod
 
Kinda silly question why is -2 mod 8 = 6?? can anyone explain me plz :)
[2 replies] Last: Because it is treating -2 as if it is 0xfffffffe (32-bit) (how the com... (by histrungalot)
Binary files
 
Hello, I'm having some trouble understanding binary files. Any explanation would help. Thanks.
[2 replies] Last: A file is a series of bytes. Each byte is an 8-bit integer. Treati... (by Disch)
Creating a Random array
 
How can I make a random array? Just for example: I have this: a, b , c , d , e ,f I want the computer to make any pattern using these. It should give me 4 p...
[7 replies] Last: thanks from all this I have got the conclusion :D Thank you very much ... (by biplav17)
Outputting a void.
 
Ok, so I just started programming today and I've been going through these tutorials. It goes into how you can output return values and all that, but then it als...
[5 replies] Last: void function(); generally means you will not return any value. Most... (by nickoolsayz)
by WayneC
How to Handle Multiple search results
 
I know how a basic linear search works. What I need to know is how to adapt a linear search function to collect and display results of a search that has more th...
[6 replies] Last: HAH! Thank you Stewbond. I'll try it tomorrow morning to make sure I... (by Wayne Cordrey)
January 2012 Pages: 1... 434445464748
  Archived months: [dec2011] [feb2012]

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