Beginners - March 2011 (Page 34)

Again pointer question
 
While I was surfing for pointer tutorials,I came across an example and couldnt get it. (This is from a question and an answer to it) Here it is: char *pst...
[5 replies] Last: When you are assigning string as: char *pstr = "string literal which c... (by techie07)
powfun Using loops
 
Hi everyone, I'm just stuck on a powfun function problem. It just states to enter an integer, enter a positive integer power, and find the result, i.e 2^3=8. I...
[2 replies] Last: int powfun(int a, int b) { int p = 1; for (int i=0; i<b; i++) ... (by techie07)
Big O for the delete [] operator
 
If you have a dynamic array and call delete to return the array to the heap, is that a constant function or a linear function? Any clarification would be appr...
[4 replies] Last: It depends on whether data is an array of POD or non-POD types.... (by PanGalactic)
problem w/ microsoft visual c++ 2010 express on 64-bit platform
 
hi, big noob here; please excuse my naivety. ; ) i'm using a 64-bit edition of windows vista. i'm trying to build a simple "hello world" program on mic...
[5 replies] Last: Are you referring to pre-compiled headers? If you create an "Empty Pro... (by Zhuge)
Implement Time Program
 
I have an assignment where I really have no idea how to even begin. It is as follows:
[1 reply] : How much do you know about classes? If you have no idea where to begin... (by Zhuge)
C++ Chapter 6!
 
1. Write a program that uses the function iSNurnPalindrome given in Example 6-5 (Palindrome Number). Test your program on the following numbers: 10, 34, 22, 3...
[2 replies] Last: you can convert a number to a string with the <stringstream> set of ob... (by ultifinitus)
Need some help
 
I am losing data. somewhere and im not sure where. I am pretty sure it is in the pushqueue function.....it is suppose to put the symbols in order by its priorit...
[2 replies] Last: You definitely have memory leaks in pushqueue(). It doesn't look like ... (by Zhuge)
function returns a pointer to the largest number in an array
 
Hi I have a question about how can I write a function that returns a pointer to the largest number in an array of size 10. the array is one dimention arra...
[7 replies] Last: finaaaally it works Thanks to all of you :) (by computer girl)
weird output in linux (works fine in windows)
 
i really have no clue what's going on here. at the very beginning of my main() i have these two function calls populateWorld(FILE_NAME); showWorld(); ...
[1 reply] : okay, never mind. the input file was created in windows. i created a n... (by prophetjohn)
Help with Program
 
The maximum allowable deflection of a beam depends on its function. For a floor, the typical maximum allowable deflection, in inches is: Dmax = L/240, while for...
[3 replies] Last: Your code has a lot of mistakes. Have you even tried to look over it y... (by Browni3141)
by Spot
Access violation reading location
 
Hi everyone! My code builds fine but I'm getting the error: Unhandled exception at 0x00413b62 in Tenta_1_del_3.exe: 0xC0000005: Access violation reading loca...
[8 replies] Last: It's also worth nothing that the above cases can be avoided if you are... (by Disch)
by broot
multiple "OR"s
 
To shorten some code I was wondering if (a || b || c || d || e) would work, turns out it does work, but is a bad thing to do?
[7 replies] Last: Also make sure no code within the || or && expressions has side effect... (by rocketboy9000)
Trouble passing by reference
 
The following program is supposed to use passing by reference and return to order to convert Celsius into Fahrenheit. I know there are more efficient ways to d...
[4 replies] Last: Thank you Computergeek01! I understand now where the error is and how... (by tempestt)
pointers and malloc()
 
i have this program that allocs memory from the stak. it doesnt work tho. here is my code int main() { int *mem_handle = ((int*)malloc(sizeof(mem...
[14 replies] Last: @Disch and anyone planning to post in this thread: http://cplusplus.co... (by Albatross)
Input
 
I was wondering if there is a way that i could refuse a user's input if it was a float data type, or rather make the user's input strictly to integers? For exam...
[2 replies] Last: How about inputting the data into a string and then searching for non-... (by Albatross)
by Krahl
stack overflow (1,2)
 
hi, I'm having a stack overflow problem in my code. I am declaring a few arrays of size 10000 and get a stack overflow error but when I reduce the size to 50...
[22 replies] Last: I wasn't being picky about using at(), it's just that when I first beg... (by Krahl)
getline(cin, string) issue
 
So I've been working on making a simple word game, but I've run into a snag. I programmed around it, but I would like to know why it is happening and can't find...
[8 replies] Last: I want the program to start again hence the while(1) but I didn't know... (by jacqu35)
reading from a file into an array
 
Teacher has supplied a txt file from which we're supposed to get the information. I've looked in my text book for examples, but those are user-input based. Here...
[1 reply] : Parsing data files is largley dependent on the format of the data with... (by Computergeek01)
UpdateWindow()
 
Hi, could you explain to me what am i doing by putting: UpdateWindow(hWindow); Ive read some informatin on the internet but i dont quite follow it. Wha...
[17 replies] Last: Not really, if you call SetWindowText the controls handle themselves q... (by hanst99)
Reading a matrix from a file
 
Hello guys, Firstly I want to apologize If I ask something silly, but I have just started learning C++, and I really don't know much. As a practice I have a cha...
[2 replies] Last: A common method is to write the size of the matrix, followed by the va... (by Duthomhas)
March 2011 Pages: 1... 3233343536... 52
  Archived months: [feb2011] [apr2011]

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