39 Posted Topics
Hi everyone! I created a Sudoku game and want to share it with all of you so you can tell me what'y think about it :). I've got 1 year of C++ experience. Game is based on coordinates to put the numbers. --------------------------- List of Commands: --------------------------- When asked to … | |
Re: Use the CSS Property called min-height. | |
Re: Check if the date function is returning the exact date as it is in the database | |
Re: Hey man I could help you further with TeamViewer or something let me know if you want my help. It's not easy to correct all your PHP since I would need an exact replica to see what's really going on, so it's just easier to just see what you have … | |
Re: Works fine on me just make sure your database name is correct and don't use spaces in the name. Also I don't see why is it that it's such a good practice not to end the php file with "?>" when it's only php... just put it there won't take … | |
Re: Try the code below made some small changes to make the code look better and actually work. [CODE] <html> <head> <style type="text/css"> label{ font-family:"lucida grande",tahoma,verdana,arial,sans-serif; font-size:14px; color:blue; } </style> </head> <body> <FORM ACTION="" METHOD=""> <label for="message_wall">What's Your Problem?</label> <br /> <textarea rows="3" name="S1" cols="104" id="message_wall" name="message_wall" value="message_wall"></textarea> <ul id="media"> <li><img … | |
Re: First use Code Tags; Second it's case 1: not case [1]: I'll provide a Switch Code for u to See [CODE] #include <iostream> using namespace std; int main() { int opt; cout << "1. Hello!" << endl; cout << "2. Bye!" << endl; cin >> opt; switch(opt) { case 1: … | |
Re: Your variable ndeps is nowhere to be found within your code you must first declare it Since you're using it in both classes and they are not related I would suggest declaring a global variable. | |
Re: you need [CODE]using namespace std;[/CODE] in the ispis2.cpp file =) Or just include the includs.cpp in the ispis2.cpp like the above post says =D | |
Re: Well instead of asking the user to input a fraction as a string you could instead ask the user to actually put 2 integers and 1 character so it would be something like this. [CODE] #include <iostream> using namespace std; int main() { int num1, num2: char slash; cin >> … | |
Re: If your using windows system("cls"); should work just fine I don't understand what the problem is.. | |
Re: I believe you kinda made an infinite loop there if I'm not mistaken, because the function isn't really returning a value it's only calling itself over and over, try this I think it will work didn't try it myself. [CODE]double calculateBalance(double initial, double rate, double term) { int value = … | |
Re: Initializing a variable: [CODE]char Test = "Initialized";[/CODE] Declare a variable: [CODE]int Declared;[/CODE] Undeclared variable: [CODE]Undeclared;[/CODE] | |
Re: when you call printPathHelper function the 'n' parameter is ever going to be = to 'start' parameter? How do you call this function? Do you send different values every call? Those questions might give you an answer to your problem. | |
Re: What do you think we are? Homework coding slaves? Show some code first then we will try to help you out. | |
Re: So if you say that n1 and n2 are 2 random values, there is no line of code inside the for loop to tell them to change their values so they always remain the same, you can't expect they will change randomly out of nowhere. Hint: If you want to … | |
Re: Your not reading the txt file to the structure so the pointer to the structure will always be null and never execute anything your just reading the command nothing else. Try to learn how to write and read structures to file. Methods read() and write(). Hope it helped. | |
Re: Change [code] for (j=1;j<=h;j++) { cout << coef2[j] << "x^(" << power2[j] << ")" << "+"; } [/code] to [CODE] for (j=1;j<=h;j++) { if(j != h) cout << coef2[j] << "x^(" << power2[j] << ")" << "+"; else cout << coef2[j] << "x^(" << power2[j] << ")"; } [/CODE] So … | |
Re: The code below shows you how dynamic arrays work. Hope it answers your question. [CODE]#include <iostream> using namespace std; int main() { int *p = 0; cout << "Forward: "; for(int x=1; x<=10; x++) { p = new int; *p = x; cout << *p << " "; } cout … | |
Re: [QUOTE=mendheim2;1168404] [code] //This section is whats giving me a hard time. void printGrade(int oneScore, float average) { string grades, file; ifstream rss; // You are not opening the file // You should do ifstream rss("filename.something"); int scores[MAX_SIZE]; // OR HERE rss.open("filename.something"); rss >> scores[oneScore]; oneScore = 0; while (!rss.eof() && … | |
Re: > `if(felix == "ho")` Change this line to `if(strcmp(felix,"ho") == 0)` Also make sure you put return 0; at the end of your int main function. | |
Re: My advise for you, first try to think and solve this problem by your own if even so you don't get to a conclusion of the problem then come back here and post what you have done so far, just don't come here and expect everyone to do all the … | |
Re: Create another variable to store the number of 1's. You go through all elements of the array and each time it equals 1 you increment that variable by 1. You could think of that by yourself ain't that hard. | |
Re: Try to understand this piece of code [CODE] #include <iostream> using namespace std; int main() { char s[10]; char *cpt; cout<<"Text: "; cin >> s; cout<<"Middle Array Element: " << strlen(s)/2 - 1; cpt = &s[0]; cout << endl; for(int x=strlen(s)/2-1; x>=0; x--) { cout << cpt[x]; } return 0; … | |
Re: Either what above is said or just use pointers :) [CODE] #include <iostream> #include <fstream> using namespace std; class HotDogStand { public: void JustSold(int DogCounter, int numCarts, HotDogStand *HDS); // Here int Cart; int IdNumber; int SalesToday; int TotalSales; int IncrementalSale; int DogCounter; static int HotDogCartSales; }; static int HotDogCartSales; … | |
Re: I dont know if this is what you want but.. You can ask the user how many carts there are and with that you can make a dynamic array which will allow you to have only one variable to store the carts ID. So it would be something similar to … | |
Re: That's easy you are saying your program to go 13 to the right but you're missing the point where it pass through 'z' and needs to restart back to 'a' you just have to tell the program that. So ascii code of 'z' is 122, so you must tell your … | |
Re: Instead of using [CODE]strcpy(this->firstName, firstName);[/CODE] use instead [CODE]this->firstName = firstName[/CODE] strcpy is more suited to pass from string to char * | |
Hello, today I got a new issue on the program im developing so.. the issue is that I want to change a file in this path [B]C:\Users\[USERNAME]\AppData\Roaming\[PROGRAM NAME].[/B] But the thing is when a user's computer has a different language then english this path changes to something like this [B]C:\[Users … | |
Hello everybody, I'm trying to get the user name using GetUserName() API function, it was sucessful in the console project however in the Visual C++ project it gives me this error: [CODE] 1>MyProgram.obj : error LNK2028: unresolved token (0A00000F) "extern "C" int __stdcall GetUserNameA(char *,unsigned long *)" (?GetUserNameA@@$$J18YGHPADPAK@Z) referenced in … | |
Re: You should also make a system("cls"); when recalling the board to clean your screen else it will accumulate. If you prefer not to use the function explained above by our comrade you can recall your main function like this: [CODE] void recall() { system("cls"); // Clears your screen main(); // … | |
Re: What actually is your problem? I tested and the program runs fine. | |
Re: I would love to join the team I know C++ for about a year now. I still do not understand about 3D concepts or any stuff related to making a "real" game, not a crappy console game if you know what I mean ;). Anyways my dream is to become … | |
Can anyone tell me how or help me to get a Window's Title and save it to a TXT file? I tried couple of things with the GetWindowText() but only manage to get some numbers. | |
I made a function SetRegistry() to write a string in the registry like this: [CODE] void SetRegistry() { HKEY hKey; RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Run"),0,KEY_SET_VALUE,&hKey); RegSetValueEx(hKey, TEXT("filenamehere"),0,REG_SZ,(LPBYTE) "C:\\Windows\\filenamehere.exe",sizeof("C:\\Windows\\filenamehere.exe"); RegCloseKey(hKey); } [/CODE] NOTE: C:\\Windows\\ is the path where the .exe file I want to add is. it sets the string with the filename and … | |
Re: [QUOTE=samsons17;1045382]i tried to do something like this in one of the program i made.... if the user entered something that is not the same with the number and the word that are available in the program,it will ask the user to enter the input again.. But the problem is that … | |
Re: I have to do a final project next year to, I know C++ and I want to make a 2D game. Something cool and not too complex. | |
Re: I think you want something like this? a. "one thing" b. "another thing" option: ----- for this u must declare a char type variable and do a switch for example.. like the explanation i'll give below char option; switch (option) { case 'a': do something... break; case 'b': do something... … |
The End.