Forum: C++ 5 Days Ago |
| Replies: 6 Views: 220 2001 % 5 = 1 .... i was showing you that "num" was correct before returned... this has nothing to do with passing by reference... the returned number of function mod should be 1... not... |
Forum: C++ 5 Days Ago |
| Replies: 6 Views: 220 Here is an example... why are num and ans not equal?
#include <iostream>
using namespace std;
int mod(int&,int&);
int main()
{
int num = 2001, |
Forum: C++ 5 Days Ago |
| Replies: 6 Views: 220 hey im trying to do a quick mod function, i know % exists but this will have other applications... Basically the main issues is when you return "num" it is a different value than if you look at num... |
Forum: C++ Mar 25th, 2009 |
| Replies: 6 Views: 1,128 I think you should ask your professor since its your program for his class.. he gets paid to help you |
Forum: C++ Nov 5th, 2008 |
| Replies: 1 Views: 267 Hey, my program is having trouble in the Solve() and Check() functions... basicaly, the Check() function is returning 1 or 0 based on different condtions, however after the 3rd or 4th time the value... |
Forum: C++ Nov 2nd, 2008 |
| Replies: 3 Views: 447 how am i derefrencing it? |
Forum: C++ Nov 2nd, 2008 |
| Replies: 3 Views: 447 Hey, im trying to print what is stored in my 2d dynmic array from a file in my print function. However whenever i try to access information in the array, it crashes the program. maybe the array is... |
Forum: C++ Oct 6th, 2008 |
| Replies: 4 Views: 490 wow, thank you, i feel very noob lol |
Forum: C++ Oct 6th, 2008 |
| Replies: 4 Views: 490 i fixedthe line 62 to :
ptr->item = item;
but why would ptr->next never = NULL ? |
Forum: C++ Oct 6th, 2008 |
| Replies: 4 Views: 490 I am stuck, im trying to insert and print out this list of numbers from a file, however i just get an infinite loop every time... any suggestions?
// This is the implementation file for class... |
Forum: C++ Sep 20th, 2008 |
| Replies: 4 Views: 853 The function getdat works fine... if you print the data to screen using a for loop, you can see that the information is being stored correctly in the arrays.
void getData(ifstream& data, string... |
Forum: C++ Sep 18th, 2008 |
| Replies: 4 Views: 853 Hey, ive debugged my program to this line, and im not sure what to use, strcpy or some other thing, but i need to get the string from a[x] in to the new string c[z]. Any suggestions?
string... |
Forum: C++ Apr 14th, 2008 |
| Replies: 12 Views: 931 It is actualy better to write this as one if statement, it saves time for both you and the compiler. btw not to be mean, neither of the comments made help him with the infinite loop error |
Forum: C++ Apr 14th, 2008 |
| Replies: 12 Views: 931 You made 2 simple mistakes....
•In the for loop, num1 will always = num1
• and your while loop will always be true because num 1 and num 2 never change... here is a fixed version
[code]... |
Forum: C++ Apr 13th, 2008 |
| Replies: 2 Views: 1,276 Hey, im trying to use pointers with a struct. I am having an issue in the function searchData. I can not get the pointer to compair with the string, it is still just compairing the actual adress or... |