Beginners - October 2014 (Page 11)

by clodi
3D cube CORNER-CASE neighbours
 
Hello, I am coding a 3D cube with 10x10x10 little cells. Every cell has a number ID and it also stores the IDs of its neighbours. So I go: for( int i = 0...e...
[3 replies] Last: //FRONT - SECOND SHEET - EVEN site[ i ].setNeighbourID( 0 ,(i) );... (by clodi)
by adam43
For Loops
 
Write your question here. I am wondering how i can take a phone number such as 9032389960 and add all the numbers together and output it using for loops. I nee...
[1 reply] : http://www.cplusplus.com/reference/cstdlib/itoa/ http://www.cplusplus.... (by Darkmaster)
dice roll simulator
 
I was given the code below by my proffesor, and asked to modify it so it can keep track of how many times it receives a particular result and prints an asterisk...
[2 replies] Last: @el rookie You could create an array of size 6, and initialize it to ... (by whitenite1)
need help understanding what to do
 
i have a program for my 350 class i need to do but me and my classmates dont understand how to go about it. we have asked the teacher and he just say the same t...
[8 replies] Last: @dhayden ok he just told us that each type of the jobs are independant... (by andrewthecoder)
insert text files into object of class
 
So I want to insert a text file into an object of a class called SortedList. the text file contains floating numbers: 5.5 6.2 7.1 8.0 9.0 10.0 1.0 2....
[no replies]
Help with struct Arrays and File Operations
 
So I posted earlier but almost completely reworked my code. The problem is that the function that the Fish struct array is passed to only correctly displays the...
[1 reply] : Switching between the extraction operator<< and getline() will often c... (by jlb)
by clodi
3 lines of code and an error I can't fix..
 
It won't compile. It says my call is "ambiguous" int Lattice::XYZtoIndex( int a,int b,int c ) { return (int)(a + (b*pow( NSITES,2/3 )) + (c*cbrt( NS...
[3 replies] Last: yeah, just fixed it. % operator needs two integers (by clodi)
by iBlueZ
Need Help
 
My question is how would i write my code to allow only m=male to appear only not the f=female. I'm sorry if thats too much to ask i just started learning so im ...
[2 replies] Last: cin >> gender; while (file >> name >> birthyear >> salary >> gender) ... (by wildblue)
Need help with this code
 
Hi, most of this code is working, except the part where it's supposed to output the code into the text file. The file remains blank after I test this code. Am I...
[3 replies] Last: marka = mark * .15 + mark; You're taking 15% of mark and adding it ... (by wildblue)
by nasser
Ubuntu 14.04.1
 
What is the best IDE/Compiler for Ubuntu 14.04.1
[3 replies] Last: Well if you would like an IDE, the top two that I would recommend are ... (by closed account EwCjE3v7)
constant pointers
 
is not the first time I've asked this question...but i hope this time i get a very clear answer once and for all...the difference between constant pointers and ...
[5 replies] Last: I'm glad, good luck :-). (by Jacobhaha)
by drax
go to loop
 
I am trying go to loop, but whenever I run this code, my program crushes, although I didn't have any errors in it. I don't know why, could anyone explain, pleas...
[2 replies] Last: was such an obvious mistake, thank you! (by drax)
Writing a "for" loop to convert binary to decimal
 
I am using Brackets, and I need to write a for loop that converts a binary number into a decimal. The requirements are: -Write a for loop that iterates from...
[2 replies] Last: Also, some additional hints are: The value at each position in the bi... (by happy02)
How to execute a code from file?
 
Lets say my program reads the c++ code from a file. Program puts all that code into a string, and calls a compiler to execute it. How it could be done? Maybe w...
[2 replies] Last: A compiler is not going to be able to read it's input from a string in... (by AbstractionAnon)
Inserting in a simply linked list from a file
 
hey everyone, the title says it all tho. I need to create a simply linked list and save into a file, thats very easy, but i cant figure out how to fill again...
[no replies]
multi map count for string key's
 
This website has an example of how to get a count of duplicate keys for chars when using the multimap, but how could this be implemented using strings? any ide...
[16 replies] Last: Can someone help me figure out how to make a key pair for parsed words... (by theironlion23)
by iluv41
array type not assignable
 
What does this error mean? Array type char not assignable What could be the workaround to add the elements of a new entry to an array? This is the function...
[5 replies] Last: It looks like you should do something like this: e.Set(tempTitle, tem... (by kevinkjt2000)
by iluv41
char to enum type?
 
How could I convert a char from cin to a specified enum type? The enum type is as follows in entry.h: enum Category {SONG, POEM, ESSAY, NOVEL, NOTE}; and...
[1 reply] : that switch would work. providing you remove one of the duplicate line... (by mutexe)
little help pls
 
...
[1 reply] : it's because regardless of when the user types 's' you still output yo... (by mutexe)
by T4l0n
update the root in avt tree
 
I am learning avl trees but i cannot manage to update the root after a rotation, in this code i only wrote the left rotation and it works but when it returns th...
[2 replies] Last: yes, thanks (by T4l0n)
October 2014 Pages: 1... 910111213... 70
  Archived months: [sep2014] [nov2014]

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