Beginners - December 2010 (Page 28)

by GOct
Flattening a 2D array efficiently
 
Hi, I need to flatten a 2D array **A efficiently, so I was thinking at two methods: 1. int k=0; for(int i=0;i<lines_A;i++) for(int j=0;j<lines_A;j++){ ...
[2 replies] Last: I'll just leave this here.. http://www.cplusplus.com/forum/articles/1... (by hamsterman)
Newbie program creation - chocolate sales
 
Hi, I am a student studying programming and design. I have been given an assignment and I just dont know where to start, if anyone can help me in the right dire...
[1 reply] : #include <iostream> int main(){ //your homework goes here ... (by hamsterman)
Type Conversion Suffixes
 
I have a problem writing literals on the compiler. When I declare variables as: int Variable = 5; this not have any problems, because my book said that li...
[1 reply] : f or F =>float l or L =>long double or long (depending on context) u... (by chingi3)
Sorting Class String Array
 
Hey everyone, Im working on this project and im having trouble sorting an array and I cant figure out what I did wrong. grocery is the class in this projec...
[2 replies] Last: I think you should begin your main loop from 1 not from 0 for (int ... (by chingi3)
♪ c++ program crashing down crashing down ♪
 
Hi guys, I'm starting one program and I'm getting an error on this loop, and I'm just starting :S Just after finishing it crashes for(i=0; i<=n; i++) ...
[4 replies] Last: I dropped the loop and used this instead for( int i=0; i<x; i++ ) ... (by claudiordgz)
need ideas
 
so im a starting out comp sci major and ive been learning c++ in class and i have a basic understanding of it... so i want to do a little side project to lea...
[2 replies] Last: well ive gone over tutorials on creating a window and i think im confi... (by rkdjr1234)
by toktam
access file system in fat32
 
i want access FAT and read list of free blocks,bad blocks and a file blocks!how can i read partition table and access head of file blocks?
[no replies]
Why use typedef struct instead of simply struct
 
Hi, I can not see the difference in: typedef struct { float x,y; } Vector; typedef struct Vector { float x,y; } ; And struct Vector...
[2 replies] Last: +1 Zhuge. The typedef thing is a weird C thing. You don't have to ... (by Disch)
Call Script From C++
 
I have a Python script that I've made to convert the output file of a C++ program. I'd like to have C++ call the script but can't seem to find a good way to do...
[5 replies] Last: system command only works if your C++ program don't intend to receive ... (by sohguanh)
by talt1
Displaying Arrays using pointers instead of subscripts
 
I'm writing a code that is suppose to display the sum of two arrays added together into one array. Also The results are suppose to be displayed using subscript...
[3 replies] Last: int a = {1,2,3}; for(int i=0; i<3; i++) cout << *(a+i) << "... (by sohguanh)
prime factors of a number
 
Hello, I had homework to make a C++ program which outputs prime factors of inputed number. So my program is "supposed to" do something like this: INPUT: 6 ...
[1 reply] : you don't use the dividers array anywhere. it should be for(int i = 0;... (by hamsterman)
String Coding
 
I'm looking for help in how to properly modify my program so that a display message will indicate the number of incorrect guesses that remain each time the user...
[no replies]
by firix
Which books should I read?
 
Hi I want to ask you something I have read the book two times in C + + programming language(Bjarne stroustrup). now I want to read the following books which...
[5 replies] Last: Hello Guys, Please write about this book... (by firix)
decimal to binary
 
can anyone tell me what is wrong with my code? its print out 100000 and then some weird symbols when i input 5 as my value. i know that at least the first numb...
[3 replies] Last: Hello jsmith, I did not understand exactly what you say... (by firix)
How to cut getline short
 
My input file has the following format First Middle Last, First Middle Last, First Middle Last The Middle is optional. How can I do a getline and have it s...
[2 replies] Last: That easy, eh? :) Thanks a bunch! (by Banana29)
Polymorphic constructor?
 
I have an abstract base class (which means that an object of it is never instantiated, correct?), and another class that inherits from it. Entity.h clas...
[3 replies] Last: did you comment out the AddSkill function in the cpp file? cuz if not ... (by ERanz21)
Can't find a certain constructor.
 
Hi, I'm trying to use some code that I downloaded from the internet and I'm having difficulties constructing objects that contain objects whose type is defin...
[3 replies] Last: Doh, Just realised that I wasn't linking my files properly. So... (by Despot Despondency)
two demension arrauy
 
Hi I want to extend a two demension array in every funcion call. THis what ive got so far: #include <iostream> #include <conio.h> using namespace std; ...
[2 replies] Last: Thanks alot! Problem fixed and works prefectly (by alokado)
sizeof operand and undeclared identifier errors
 
I'm getting these errors when I try to compile my program: (7): error C2065: 'percent' : undeclared identifier (7): error C2065: 'percent' : undeclared ide...
[4 replies] Last: Got it to compile now, thanks for your help. (by closed account GhqjLyTq)
Arrays
 
Hi, in my program i have a array called inventory, see below: inventory [numItems++] = "sword"; inventory [numItems++] = "armor"; inventory [numItems++] =...
[10 replies] Last: ah ok, thanks (by TpOreilly)
December 2010 Pages: 1... 2627282930... 35
  Archived months: [nov2010] [jan2011]

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