Beginners - February 2011 (Page 7)

malloc and pointers advice needed
 
Can someone expalin what int *x=(int *)malloc(n*sizeof(int)); means
[1 reply] : sizeof(int) is the amount of memory needed for one int (usually 4 by... (by hamsterman)
by shan03
Build error?
 
I got the follwing error....while I build my program...I am using dev c++ v 4.9.9.2..console application..... Compiler: Defa..lt compiler Building Make...
[1 reply] : Looks like you mixed gcc libs (.a) and non gcc libs (.lib). Remove the... (by coder777)
Pointers
 
I am now trying understand pointers properly. Can you tell me if im right with my notes below: See below: // my first pointer #include <iostream> using ...
[19 replies] Last: Tip: read the read the declaration backwards, it is very useful especi... (by closed account z05DSL3A)
Strange incrementing problem
 
Hi, The main aim is to read a file and output its content. The content of file is abc def ghi int main() { int i=0; FILE *fp; ...
[4 replies] Last: You are using C to perform the task I have included a heavily commente... (by mikeofthenight)
how to do this in array?..
 
The problem is to make this a triangle using array, i already made a triangle using only for loop but i don't know how to do this in array.. here is the code...
[3 replies] Last: Not quite, but without answering your problem completely, here's what... (by cbeginplusplus)
C/C++ programming using netbook
 
can i use a netbook(not laptop) to do programming? not just for typing the code but also for compiling, debugging, and building code. i don't have a laptop o...
[1 reply] : Of course you can, but it might take longer to compile your programs. ... (by rapidcoder)
by w1llux
Grade calculator
 
Okay, so i am attempting to write this program in which the user is prompted to enter the number of students (N) who took a test and their scores. it then asks ...
[1 reply] : Something like this // function 1: inputs (Scores ), outputs(Grad... (by cbeginplusplus)
by shan03
Build error?
 
I got the follwing error....while I build my program...I am using dev c++ v 4.9.9.2..console application..... Compiler: Defa..lt compiler Building Make...
[no replies]
Phone Plan Comparison
 
I am in a beginning C++ class and for our program we have to allow the user to enter two cell phone plans including its minutes allowed, and monthly payment. Th...
[15 replies] Last: Kind of, Here is a simple example. #include <iostream> void ... (by Zaita)
Code Clean-up
 
#include <iostream> #include <string> #include <limits> using namespace std; int main() { int monthlymins = 0, overA = 0, overB = 0, month = 0, mi...
[6 replies] Last: Okay, i see what your saying. Thanks!! :) (by knicole89)
Declaration problems
 
I am trying to make a function that recursively adds up the data areas of a linked list and finds the sum of all the cells added together. I put the class toget...
[4 replies] Last: awesome it works now, just had to re add all of my stuff i did before ... (by sorthon123)
passing arrays to functions
 
I would like to pass the seats array to the void function but i have only learned how to pass constants to a function. How do you pass an array to a function? ...
[2 replies] Last: Thanks very much! It works without errors now! (by Ahlquist50)
Accessing windows streams through C++
 
In windows (or at least some versions of windows) there is a functionality that allows for certain types of files to have streams which can be accessed pretty m...
[1 reply] : It is an NTFS filesystem 'feature'. The word "streams" does not mea... (by Duthomhas)
Recursion
 
We are trying to go through a linked list and add all the values together and then return the sum using recursion. Can anyone help us with this please? //...
[2 replies] Last: See this thread: http://www.cplusplus.com/forum/beginner/37056/ for a ... (by closed account D80DSL3A)
Beginner Having Trouble
 
I recieved this assignment for my beginner's c++ course and I am having trouble even beginning to write pseudocode for this. I was wondering if anyone would be ...
[1 reply] : that's beginner's eh? alright, seems a little high for the beginners c... (by closed account 4Gb4jE8b)
String to binary/dec/hex/oct
 
Doesn't matter which one really. I want to try my hand at encoding something, so i chose a word, and tried this: #include <iostream> #include <iomanip> #i...
[5 replies] Last: Well upon further reading, I found an interesting way of doing what i ... (by closed account 4Gb4jE8b)
Calculator's deffect ( not complete character intake )
 
This program, is the simple calculator. I'd a task, to write something like this, but the "original" one is a little bit more complicated. Problem in input ( a...
[7 replies] Last: I'm interested in such way: for (int j=0; j < div.size(); j++) { ... (by TJbla2e)
Array Declaration in Functions
 
I kept on compiling it and it's always giving me some errors which I can't figure out. A little help please? #include <iostream> using namespace std; ...
[6 replies] Last: how can I match it? address (&array1, &items); doesn't work either.... (by camille1411)
Adding files
 
So, I have a project that I've made in Xcode, with two source files. One is called, "Working Blackjack," and the other is called, "Hello World." I want to kno...
[1 reply] : The file you wish to include must be either in the same directory as t... (by ModShop)
[C++] Array Comparison
 
A simple problem as a password comparison using arrays, I've been doing this for 21 hours and this simply doesn't work. I don't know where are my errors. Beggin...
[1 reply] : This cin >> guess ; almost certainly does not do what you think it d... (by Moschops)
February 2011 Pages: 1... 56789... 43
  Archived months: [jan2011] [mar2011]

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