Beginners - April 2010 (Page 14)

using cache and parallelize for cicle
 
Hi, I am quite new to c++ and my teacher tell me a question I can't answer. for (i=0; i<Nu; i++) { for (j=0; j<Nu; j++) { ...
[3 replies] Last: It's a part of a g++ program to do moltiplication of matrix. (by venturozzaccio)
returning error
 
Hi, my question is how to return an error in a function that is supposed to return an object. I have a class declared as: class MyClass { ... } I ...
[7 replies] Last: This is pretty much exactly what exceptions are for. I think throw i... (by closed account jwC5fSEw)
saddles in a matrice
 
Hello friends, Some time ago I had a homework, I needed to write a program that tracks and counts saddles of an imported matrix. Do not worry, I have done my h...
[10 replies] Last: I'd be interested to know that as well as to why in this case global v... (by Albatross)
Basic ASCII game trouble
 
Hello community. I am trying to program a basic text based game based on what I can remember from high school classes, and I'm stuck on a certain part. I've se...
[8 replies] Last: Oh. Well It was missing a function, so I thought there was another cpp... (by oghmaosiris)
Cin not failing for reading unsigned int
 
Hi all, Got a really simple question. I feel I'm overlooking something. unsigned int tempNumber; cin >> tempNumber; while(cin.fail()) { /...
[2 replies] Last: Thanks heaps for your response. That's weird behaviour, don't you thin... (by sammy34)
Independent and ambiguous variables
 
Ok so how do i make variables that are not part of any function but can be changed by other functions in the program....im trying to write a text game and i nee...
[3 replies] Last: Unless it's a typo in your post and not in your code, you are comparin... (by jRaskell)
converting type double and int into strings
 
Hi everyone. I have a program that I used about six variables in. Five variables I used type double for and the other one I used type int. How do I convert t...
[10 replies] Last: #include <windows.h> #include <sstream> template <typename T> ... (by blackcoder41)
ifstream
 
Hello, everyone, thanks for the site and the support. I need to read an ansi encoded .txt file. (http://www.cplusplus.com/reference/iostream/istream/read/) ...
[11 replies] Last: Opening in ios::binary with fileData = new char[fileLength+1];... (by NeoGeoEch13)
Default not working in switch statement!! (1,2,3)
 
Okay…now I’m getting frustrated. I’m trying to fix a problem pointed out to me in my switch. Originally, I was not using a loop in the default clause and ...
[40 replies] Last: Line 19 calls the Playerinfo() function and stores the return string i... (by jRaskell)
by mzdr
cs2144 and 2146
 
Im not to sure whats going on in my code. granted ,I am a noob. What I'm trying to do is create a function and then call that function in the mai.n I think I...
[8 replies] Last: I want to thank all that replied to this thread.All of the reply were ... (by mzdr)
[C] Reading data from file per line
 
Hi, I'm trying to program an application in C that will open a file do certain operations depending on what the line contains. For example, if it opened this fi...
[3 replies] Last: Short answer: Yes. Long answer: A file is simply a sequence of char... (by Duthomhas)
A question on using "++" and "+=" (1,2)
 
What's the value of a after executing the following code segment int a = 4;(a++)+=(++a); I am quite confusing about this kind of "++" "+=" tricks....
[29 replies] Last: This isn't theory. It is fact. The C++ language standard states quite ... (by Duthomhas)
by beerz
Using Functions to create an arithmetical quiz
 
I am stil finding my way into functions in c++. I can't figure out how to sketch out the code for the below exercise. It has also been repeated to given as a pr...
[6 replies] Last: That's fine if you want to help yourself by solving others' problems, ... (by jsmith)
class is not a template
 
I'm making a simple stack template and the compiler (g++) is complaining about the class not being a template: hadoque@meitner:~/skola/c$ g++ -o driver dr...
[no replies]
trying to calculate height based on length of leg bone
 
Hello, I'm working on some problems for my c++ class and this one is giving me a lot of trouble. According to the question (which is about calculating a pers...
[17 replies] Last: I did attempt to communicate to you on at least one occasion that at l... (by Albatross)
If I have a menu how do I display an error message for character inputs?
 
I want it so that the user can only input 1-5 and choose one of the cases, but if I input a letter the program just loops over forever and pretty much is broken...
[14 replies] Last: Now that really sucks, but I guess it is proper C++. If they didn't pu... (by Albatross)
Two functions - One working, one not.
 
Hi all I'm having an issue with my program utilizing two functions. Both functions do essentially the same thing. They're both supposed to do the calculation...
[4 replies] Last: Thanks for the input (and the compliment, btw). Seeing as this is an i... (by Flat Four)
How to clear a previous file to open a new one
 
Hey, I'm pretty much almost done with this program, but I'm not sure how to clear a previous file (after opening it) in order to open a new one. My program is s...
[5 replies] Last: I tried resetting the size variable by inserting size = 0; right befor... (by crodriguez08)
by badass
reading spaces from file
 
basically im trying to read characters from a file and store them in my linked list...but my code doesnt read white spaces...when i print the list theres only c...
[1 reply] : Please use [ code] tags. The skipws flag is on by default. You n... (by Duthomhas)
by garob
Debug and see contents of variable passed by reference
 
Hi I am working on a program where I have to pass a variable by reference, but the problem is that as I step through the function the debugger in Dev-C++ it ...
[3 replies] Last: There's no reason to use print statements when you can use the debugge... (by closed account jwC5fSEw)
April 2010 Pages: 1... 1213141516... 35
  Archived months: [mar2010] [may2010]

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