481 Posted Topics
Ok So I'm a newbie to HTML & CSS anyway I decided to play around with a dreamweave default page and now I'd adding in a menu section on the left hand side. And I'm getting blnk unwanted space inside the dive before my list item and I cannot work … | |
Re: Create a structure containing both the food and its caleries. something like this [code=cplusplus]struct food{ string item; int cal; };[/code] Then create an array of that structure store all the value into the array ie food[0].item = "crisps" & food[0].cal = 200 etc. Then use food[i].cal to do your check … | |
Re: It's not as easy as it sounds, since there is alot of information in an xls file, ofcourse there are different versions too. [url]http://sc.openoffice.org/excelfileformat.pdf[/url] Normally when you are a beginner looking at something like this, you would use CSV files, as they are much easier to read etc. Please note, … | |
Re: My first thoughts are, why have you dragged an 11 month old thread up! My next thoughs are: Standards do NOT state that argv[0] is the filename. However it is considered good practice to make this the case. So if you are after true portability then you cannot rely on … | |
Re: You cannot asign an unknown value to the size of an array at compile time. You need to use dynamic memory. [code=cplusplus]double *P = new double[N]; ... delete [] P;[/code] For the second bit, you cannot do a mathematical equation on the left hand side of an assignment operator. It … | |
Re: Nobody will do your homework for you. Post some example code and your problem and we will happily help. Chris | |
Re: The size of arrays are resolved at compile time, when [I]qs_pair[/I] is 10, thus when you enter more than 10 you will get overflow errors. You should be using dynamic allocation when dealing with creating an array of size N where N is specified by user input. [code=cplusplus]int *example = … | |
Re: Well you need to give us a starting point as to what you have, my suggestion is that you have an image placeholder thingy, and then change the source of it when each button is pressed, ofcourse I can't use any technical names because I dis-like MFC :) Chris | |
Re: Don't bother using text tags for yout text, thats not what its for. it stands for Latex, a Mathematical Notation Syntax. Secondly, we don't know what your program is supposed to do and what it is or is not doing, so we can't help you. Chris | |
Re: Perhaps his real question is how can he compute the value of that series to a given figure amount using C++? | |
Re: use a string comparison function rather than a pointer to the first letter in the string. Use strcmp(). Chris | |
Re: First of all, i'm going to assume that you are using Visual C++, since after all thats the link you posted. Please make it clear if you are using Manged or Unmanged Win32 for your application, even better make it clear what operating system you are using too. Since linux … | |
Re: Please use code tags, [noparse][CODE=cplusplus][/CODE][/noparse]. Firstly, is this C or C++ because it looks like a strange confusion between the two. The only header you should be using in this program is [ICODE]#include <iostream>[/ICODE] not with a .h or anything else funky. I'd suggest you go back over the very … | |
Re: scanf() Have a quick read over a basic C tutorial | |
Re: It's a combination of the F4 key code combined with the alt modifiers, you need to check both. But i'd avoid trying to prevent it if I was you.... | |
Re: [QUOTE=Duki;819502]have you tried [code]system("pause") ;[/code] ?[/QUOTE] :O You could have at least gave a platform independant solution![code=cplusplus]cin.get();[/code]oreven better yet, run your [I]commandline[/I] program from the [I]commandline[/I]/termianl xD Chris | |
Re: You are trying to return a class object when your function says its return type is void...you missed a semi colon, and you are trying to cout<< a class object, so you either need to change what you are trying to cout or overload the << operator Chris | |
Re: Well if you are using time.h which should be ctime in C++, then you can simple calculate when the next time a minute has passed so says its currently 12:31 then you can add 1 to that and check to see if the systemtime matches or is greater than it, … | |
Re: You are still not using code tags, I expect your replies from now on will be of little help to you, read what I put carefully as it may be some of the last half decent advice you get before people just satrt saying your doing it wrong as it … | |
Re: You were correct, in the fist cast it would take O(N+1) time to push/pop, since it would be N for traversal and 1 for the push/pop. In the second case it would be O(1) since you already have the last element. Chris | |
Re: Firstly, please you appropriate thread names, rather than things such as "Help me!" or "Problem!" Your problem however is the fact that you are calling your constructer as Coord(), not Coord(float, float), and you haven't definded or declared a constructor of Coord(). Chris | |
Re: Well you might want to use getline(), but the reason it doesn't work is that the ifstream constructor requires a C-Style string i.e. null terminated character array, not an object of type string. Thus you will need to use.[code=cplusplus]ifstream myfile(fil.c_str()); [/code]Chris | |
Re: when you use cin>> characters are left in the input buffer, then when you call getline() the characters that are left in the input buffer, thus effectively skipping it. So you should call that function he has used after your call to cin>> and before getline() to clear the input … | |
Re: Damn, forum rules much...did you read? I'd suggest that you don't post that many lines of code. You are refering to line numbers, yet you didnt show line numbers....[noparse][code=language][/code][/noparse] tags would have done the job, I suggest you shrink it down to a small example that has the same problem. … | |
Hey guys, i recently installed Xubuntu 8.04 on my pc. And have been having issues getting my Belking wireless adaptor to work. I followed an online guide and it now appears that my wireless adaptor is being recognised. However i am unable to "find" and connect to my netowrk... im … | |
Re: Your class needs to implement [i]ActionListener[/i]. Then ofcourse you will need to set actioncommands etc for each menu item. Chris | |
Re: Have you written your program in MSVSC++? If so then it's probably .NET code and will require the users has .NET framework installed, and that you have distributed the required DLL files. Chris | |
Re: I think you should re-read your previous thread about creating 2D arrays witht he new operator. Look at the following two lines, If I remember correctly, I stated that to create a two dimensional array of chars such that you get a 1D array of strings, you should have the … | |
Re: You need to pass two parameters to the function, I guess you could always do something like overload /= ? Chris | |
Re: The other option would be to close the file stream and then re-open, btw be sure to check that you actually need to read the file stream twice, rather than loading it contence into some data structure then reading that again. Just pointing that out because file access is slow … | |
Re: Do you mean how do you compare the value of crop at one node with the value of crop at another given node? It's as simple as it sounds.... [code=cplusplus]aNode->info->crop == anotherNode->info->crop[/code]Chris | |
Re: If you want to raise something to the power of something then you have two choices, A) include <cmath> and use its pow() function. B) Write and recursive, or none recursive power function of your own. The reason it is spitting out random numbers is because you are calling an … | |
Re: Well you know you have reached the end of the linked list if the pointer to the next is equal to NULL. By the way, you can do this with only the original linked listed, so there is no need for extra data structues :) But that might be a … | |
Re: Are you talking about printing out the source code?? If so research Quinnes :) Chris | |
Re: [icode]Rectangle myRectangle = Rectangle();[/icode] should be [icode]Rectangle myRectangle = [B]new[/B] Rectangle();[/icode] The second too, I suggest you look at the function. Notice you declare them as taking two parameters yet you call them with 0. Chris | |
Re: [url]http://www.daniweb.com/forums/thread78223.html[/url] [url]http://www.catb.org/~esr/faqs/smart-questions.html[/url] [url]http://www.daniweb.com/forums/announcement8-3.html[/url] Please enjoy the rest of your day sir. Thanks, Chris | |
Re: You may find your router has a 'virtual server' set up of some kind, if it has then it will allow you to add incoming requests to the list. This will give you the option to have you router watch the information coming on a sepecfic port then forward that … | |
Re: You need to link "gdi32.dll" into your project :) Chris | |
Re: So who do you want to answer it or are you happy wasting the time of two sets of people? Chris | |
Re: What exactly is the problem? this works fine for me....nvm EDIT: of you need to loop through each character rather than just using the first one Chris | |
Re: Her is an example, [code=cplusplus]#include <ctime> srand((unsigned)time(NULL)); int a = rand() % 10 +1;[/code]this code stores a value between 1and 10 :) Chris | |
Re: [QUOTE=Richy321;790078]Also on a side note, alot of fps's hide the actual player model and then have seperate higher detailed models for the arm/gun specially for the first person view. This will obviously solve most clipping problems as well.[/QUOTE] This will not be a solution to clipping issues, the near viewing … | |
Re: [QUOTE=scru;798874]The print statement in python (except python 3) automatically adds a newline at the end.[/QUOTE] Should be noted that this can be prevent by doing the following [code=Python]print "Hello World",[/code]Yup a trailing ',' :) Chris | |
Re: trick is, don't move elements change points. Loop through from the start, store the first address, store the address that the next element points to then map it to point to the the first. hope that makes sense. Chris | |
Re: Well sounds to me like you are going to want to dive into the Win32 API, google it. The documentation on it is amazing. [url]http://msdn.microsoft.com/en-us/library/aa383749(VS.85).aspx[/url] [url]http://www.winprog.org/tutorial/[/url] [url]http://en.wikipedia.org/wiki/Windows_API[/url] [url]http://winapi.foosyerdoos.org.uk/[/url] I trust you know C/C++ well. Chris | |
Re: You could use <cmath> with sin/cos/tan and implement normal mathematics, just remember that the sin/cos/tan function in cmath are written in Radians :) | |
Re: [code=cplusplus]#include<iostream> using namespace std; int main(int argc, char** argv){ int num, i; char** a; cout<< "how many strings? "; cin>> num; a = new char*[num]; for(i=0;i<num;i++){ a[i] = new char[80]; cout<< "enter a string: "; cin>> a[i]; } for(i=0;i<num;i++) cout<< "string "<< i<< ": "<< a[i]<< endl; return 0; }[/code] | |
Re: Does the link know where and to include C headers etc.... Just link it with gcc using gcc example.obj -o example.exe | |
Re: Should be noted that to append a character to a string you can do this [code=cplusplus]std::string myString = "Hello, World"; myString.push_back('!');[/code] Chris | |
Re: Why don't you have a look at something like QT. It would be a whole lot easier. But yes you could do this anyway. Chris |
The End.