you need a semicolon ; at the end of the class declaration in the header files. Also, in the *.cpp files, remove the semicolon before using namespace std statement
class foo
{
// stuff here
}; // <<<<<<
you need a semicolon ; at the end of the class declaration in the header files. Also, in the *.cpp files, remove the semicolon before using namespace std statement
class foo
{
// stuff here
}; // <<<<<<
I've noticed for some time now that the ribbon frequently is not fully visible as if it is getting painted below the bottom of the browser's window. If I change larger font size (Ctrl+mouse wheel) it shows up again, making font smaller it disappears again. I'm jusing Chrome. It works correctly with IE9
Hunger Games -- a chick flick, pretty slow at first but action picks up about half way through. If I ignore the first half of the movie I'd give it 3 out of 4 stars, but overall it only gets 2 stars.
If you haven't done it aleady, search amazon.com for C programming books. First learn how to write standard C language programs on your pc. Once you have done that you can delve into embedded programming. I started writing embedded programs about 10 years ago and it was my experience that there are almost no books on the topic. The only one I found was from Microsoft Press. There are some differences between standard C and embedded C, but not a lot. The biggest difference I found was in stdio.h. Of course it will depend on which device you want to write for.
Want to die with a smile on your face?? Have sex with 100 vergins all at the same time :)
int bsort(int Ar[], int count, int swc)
Are you required to use that or did you make it up yourself? I would have passed count and swc by reference so that the bsort() can change it for main(). Then in main() you don't call bsort() in a loop, but only once.
Also, replace that define on line 4 with const.
const int N = 20;
int bsort(int Ar[], int& count, int& swc)
{
}
int main()
{
int Ar[N], count = 0, swc = 0;
for (int i = 0; i < N; i++)
{
Ar[i] = rand() % 100;
}
bsort(Ar,count,swc);
}
hm.. at link is showed input/output of function but no pseudocode to implementation .-. useless.
I assumed you are a competent programmer, one who knew how to think on his/her own but maybe that was reaching a lot on my part.
int and const int are not the same thing -- int is a variable that can change a runtime from one value to another, while const int may not even be given storage because the compiler may just treat it as if it were a macro by inserting its value wherever it is used.
what compiler are you using? Line 54 is incorrct because the last parameter is supposed to be std::string not an int.
You need to include <string> header file. Also, change <stdlib.h> to <cstdlib>
its customary to name the top of the tree (node 1) "head"
struct tree* head = NULL;
After allocating a new tree node check of head == NULL, if it does then just set head = newnode.
write your own similar to this. You won't need to write a complete implementation if all you need it to convert an integer to string. In that case its the same as atoi()
please make this thread as "must read"
There is only one MUST READ thread and that's the DaniWeb Rules. All others are optional just as this one should be.
Just share that what have you all done in your universities/scholl time which made you to come to this level of programming
Nothing out of the ordinary at the university. Programmers become competent and proficient by on-the-job experience, and lots of it. And they don't become proficient in every part of programming because the field is just too broad. Same idea as a medical Doctor who specializes on one part of medicine. If you want to be a jack of all trades you will not be proficient in any one. In college you just hit the highlights of programming, you don't really start learning the trade until you graduate and start working.
You will also want to study other fields of interest while in college because programming is not done in a vacuum but in conjunction with some other field. For example if you are interested in Banking you will find thousands of programmers there who also know a lot about banking.
yes. For small programs like you might write in first year programming courses it doesn't really matter a whole lot, unless of course you are learning how to write functions. They become very important in larger programs to keep the functions small and understandable.
Just because the build succeedes doesn't mean the program works correctly. Use your compiler's debugger to find out where the problem is.
The problem is line 84 -- I found it in less than 1 minute with the debugger.
[edit]I see you edited your post to correct that problem after I copied it.
The reason you need the parentheses in the macro is so that you can call the macro with something like this: mult(2+5,10/2) it will look like this when expanced
2+5*10/2 = 2 + 50/2 = 2 + 25 = 27, which is not the correct answer.
Inline functions don't have the above problem.
You could get this one. Or you could write the program yourself if you know how to forcast inventories. google might be the first place to start learning how its done.
use your compiler's debugger and find out what caused that problem.
And it wouldn't be the first time that a noob incorrectly posted a C++ question in the C forum would it?
I've done it by mistake several times.
// using the time from ^ above, convert
// secs to HH:MM:SS format using division
// and modulus
Or, just simply call localtime() or gmtime(), which will put it in a structure for you.
I am having TurboC installed in my system
Why? Sounds like that old ancient compiler is not compatible with modern computers and modern graphics cards. If you want to use that compiler then try to find yourself a 30-year-old computer, one that was made in the 1980s or 1990s.
for (int i =1; i <= 7; ++i)
Line 49: that is incorrect. All arrays start at 0, not 1, and go up to, but not including the number of elements in the array. So that line should be like this:
for(int i = 0; i < 7; ++i)
What you posted will work only inside that function. As soon as the function exits the grid will be destroyed. You can resolve that by passing a pointer to the grid to the function, something like this:
void displayBoard(char board[][10])
{
// code goes here
}
int main()
{
char board[7][10] = {0};
displayBoard(board);
}
you have to add some openGL libraries. Look in openGL docs for one of those functions and it should tell you what libraries you have to use.
IE9 on 64-bit Windows 7
[edit]Seems to work with Google Chrome that I just now re-installed.
I don't like it. When I start a new thread I get a popup asking if I want to share it on Facebook etc. Looks cute the first time, but it will get very annoying after that.
I can't edit the code I posted in this thread because it won't let me place the cursor where I need to add something. I put the somewhere then use the arrow keys to move it to the right spot but it just goes to random locations. I want to change username to username.c_str(), but can't. Refreshing the browser doesn't help.
You have to set the string before calling salite3_prepare().
std::string select;
std::string username = "AncientDragon";
select = "SELECT * FROM grammateas WHERE username = '" + username.c_str() + "'";
sqlite3_prepare_v2(handler,select.c_str(), -1, &statement, 0);
The first one. macros are evil creatures. The macro is wrong anyway. should be like this: #define mult(x,y)(x)*(y)
simple but working.
Who cares after 3 years?
Since all the cells have different values the only way to do it is in a loop, incrementing the cell values one at a time.
Are they all incrementing values like you posted? I suspect they are not because if they were then you would not need the array.
If all those values are in a file you will have to read them into the program one at a time and print it on the screen. In c++ you will want to use ifstream class to read in the data.
Is this a class assignment? If not, where did you get all that data? Many of those are not printable characers so you can't really make any sense of them, but they are all in the ascii charts.
I gave you a link to a chart that has all the hex codes. All you have to do is look in the column titled "HEX", find the code, then look look in the column named Symbol. Any 5-year-old can do that.
convert it to int and declare core as int instead of char.
The reason cores is modified each time a line is read is because cores is a pointer to the file input buffer str1. Change core to just a single char instead of a pointer so that it will not depend on the contents of str1.
The condition on line 25 seems to work because of the last condition on that line -- where count == 0 and not because ss doesn't change. If you print the value of ss on line 35 you will probably find it has the same behavior as core.
Compilers are not required to honor the inline keyword, so the first example is guarenteed to be the fastest. The other two examples may or may not be the same timing, depending on the compiler.
Can you choose to specialize in more than one of those? If yes, then specialize in all that interest you. BTW Oracle, Cisco and .NET are completly different thigs, that is, Oricle is an SQL database while .NET is a program environment, there probably is a .NET verson of Oracle. AFAIK Cisco manufactures hardware such as wifi network drivers.
no wait...its not wrong...we are just using different Compilers.
Yes it is wrong, the C and C++ standards dictate that main() always returns an int, that's the standard way all compilers do it. If your compiler deviates from that then you are likely to encounter problems if you use another compiler.
The way to delete an item is to shuffle all remaining items left to full up the gap and leave the deleted item at the end of the array. In order for that to work properly you have to keep another int counter that indicates the number of valid entries in the array.
Your program asks for the index number to delete, so that if I enter 5 then I want to delete the 5th element of the array, e.g. array[4]. The comparison on line 22 of your program is not needed because it should not be checking the value stored in the array.
What you want is to create a loop that starts out at the number entered (index) to the end of he array.
for(int i = index; i < array_size-1; i++)
array[i] = array[i+1];
After you get that working you will want to add more error checking, auch as index is beyond the end of the array or a negative value.
<deleted>
(5/9) is doing integer division, not floating point division, which means that all fractions are lost, so the result of that is 0. To correct that problem add a decimal point, e.g. (5.0/9.0) or (5.0/9) or (5/9.0). As long as numerator or denominator or both are floating point numbers it will do floating point math.
So, the great news is the std::vector was pretty darn good.
Relative to what? It was 3 times slower than hard-coded calcations.
The results make sense -- vectors have a lot of overhead that take cpu cycles, more time than just doing the calculations. The program has to make other calculations just to access the vector item.
The same reason I asked the same question awhile back, you have to hit the Refresh button on your browser. Its a javascript quirk.
report the entire program, including that missing function