Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what is "o/p"? output?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yes there is a difference between the two

str = "Test", the pointer just simply points to a string literal that resides in read-only memory and whose memory was allocated by the compiler when the program was compiled. The compiler reserves a whole block of memory in your program for all the string literals. You don't have to do anything specific for this. Because it's in read-only memory it's contents cannot be changed.

strcpy(str,"Test") -- with this one you will have to allocate memory for str before you can call strcpy(). Two ways to do it

  1. static allocation, such as char str[255];
  2. dynamic alllocation such as using malloc()
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

printf("%d", *(int*)6295600)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

use %p instead of %u

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Both those are declared in stdlib.h, not alloc.h. AFAIK alloc.h is a non-standard extension by gcc and MinGW compilers.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

why would you want alloc.h? You don't need it to just allocate memory with malloc(), which is declared in stdlib.h.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If you need to read the list backwards then you need a double linked list not a single linked list. Either that or just simply insert each node in reverse order.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

linked lists that can be read backwards are called double liked lists because they have both a next and previous pointers. The previous pointer at the head is NULL so that you can detect the end of the list, and the next pointer at the tail is NULL for the same reason. Lists can also have no head or tail and are called circular linked lists.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Are you confused because the output is not a double (with some decimal places) or because of the number of digits?

The output isn't a double with decimals because your program is doing integer division, not double division. Typecase either the numerator or denominator to double and it will do double division. Typecasting the entire result to double doesn't do the same thing.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

yes, that is what I mean. Its confusing to have both active at the same time.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

One way to avoid all those if statements is to set up an array of function pointers and parameter strings, then you can use a loop to iterate through the array to match the input parameters with the parameter strings in the array's structure. If the structures are in sorted order then you could use a binary search algorithm to find the function you want, or put the strings in a binary tree for searching.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

When I hit the Edit button and start editing a post can you get rid of the Reply To This Article button because its confusing to have two buttons that do about the same thing (Reply and Save Changes). I expect the button I need to press to be the last one on the screen, not somewhere in the middle of the screen with other editors/buttons below it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You downloaded the wrong version of CB. That version is intended for people who want to modify or enhance the CB ide and could contain bugs, not intended for general programming use. What you want is the binary CB with MinGW compiler. When you run the setup program it will install and configure everything for you. Uninstall what you have before trying to install the binary version.,

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

My favorite IDE on MS-Windows is VC++ 2010 Express (free), but there are several others almost as good such as Code::Blocks. All C++ compilers that I've heard about also compile C code -- just give the file *.c and it will be compiled as C code, while *.cpp file name is compiled as c++.

Regardless of what programming language you want to learn you will need to have a good grasp of highschool algebra and trig. If you can't add 1 + 1 then you will not be successful programmer. Some types of progrogramming require higher math skills or skills in other subjects such as electronics and physics. Programming is not done in isolation, instead it is always done in conjunction with other fields of study.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

try this

switch(x%2)
{
   case 0:  // even
   default:  // odd
 }
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

In c++ the best way to avoid pointer problems is not to use pointers, or use smart pointers. Instead of writing your own linked list algorithms use std::vector (arrays) opr std::list (linked list) and those classes will handle all the pointers.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The same way you did the code. Probably need to post class book.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

post the link structure

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

boost::filesystem may be useful to you because its platform independent which means you write your program once for both MS-Windows and *nix operating systems. You'll have to download and install boost onto your local computer.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

My guess is that's it's just a cloud system The originator of dropbox has a server computer that stores the data and a program (dropbox) on each computer that can upload/download data to/from the server.

How to write such a program in c/c++? The server side is probably running PHP. The client programs could be written using sockets. So if you don't know how to use sockets then that's the place to start.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Post some lines from the text file.

infile.ignore(100,'#');

Why the above lines?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The error is much more serious than just clearning the input buffer. The loop that starts on lines 21 and 41 overflow the buffer by about 20 bytes.

fgets(&suit[i],3,stdin);

The buffer suit only contains 2 bytes of memory, but the i counter counts from 0 to 20. What is it supposed to do with bytes 2 thru 20? Answer: scribble all over your programs memory space then Crash.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what gui toolkit, compiler and operating system ?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

f and g are the same question.

You didn't answer h

i is ambiguous. If they mean the value of the pointer itself, then it is true. If they mean the integer to which the pointer points, then it would be true only if memory were allocated to the destination pointer or the destination pointer already points to an integer variable.

j is incorrect

Otherwise I your answers are correct

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What driver are you trying to install? The error message has converted long filenames to standard MS-DOS 8.2 format, which is try it substituted FUNKMA-1 for Funkmaster. The only time I've seen that happen is with old MS-DOS or Win95 programs/drivers. My guess is that the driver is not compatible with Windows 7.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Just replace the line 15 with this: cout << space << '\n';

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what is your question?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I get the same error

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: page_nav

Filename: views/community_view.php

Line Number: 26

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I'm eating oadmeal for lunch, not only does it taste good but its good for the body.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You will have to do it in a loop and parse all the characters in the textbox. I assume from your description that the textbox holds all 5 numbers at the same time. If you don't know how to do that then maybe you should take some time to study loops.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That's unnecessary if the class overloads operator<(), which in this case it does.

Apparently it is necessary because that's what made it work for me (using VC++ 2012 RC)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Your program works, just doesn't work correctly. The sort is wrong, you need to add the third parameter to std::sort and write a comparison function that returns bool value. The default third parameter is useful for only POD (plain old data) types and std::string.

    bool compare(RAngle& a, RAngle& b)
    {
        return a.x < b.x;
    }

sort(l.begin(),l.end(), compare);

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Microsoft doesn't call them "widgets" -- they are "controls". For example there are Edit Controls, Listbox Controls, etc. But yes, they are all there in win32 api.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

google for "ascii table"

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If ♘ is the standard ascii character set then look up its numeric value (google will help here) and just assign like you would any other integer.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

In the file pieces.h change string ap ... to std::string ap, ...

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I tried to install Ubuntu on a computer that has a wireless network card -- it failed because Ubuntu didn't have a driver for it and AFAIK there isn't one from the manufacturer either. I find *nix just too intimating for home use -- *Inix servers are great in industrial environment, but for home use it stinks. I love the plug-and-play of MS-Windows.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What compiler do you want to use? If you are writing pure win32 api program then yes, you have to clean up after yourself otherwise it can cause memory leaks even after your program has closed. If that really concerns you then it might be better if you used something else, such as MFC, CLI/c++ Windows Forms, C#, or even VB.NET. Pure win32 api isn't easy to write and requires a lot of code/testing. The others I memtioned make life a lot easier for GUI programming.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I'm using VS2010 compiler. when i use as above statement it didnt give any build error. it built fine and execute fine

I got these warnings with your program, after adding semicolons at the end of the lines

c:\dvlp\test1\test1\test1.cpp(12): warning C4305: '=' : truncation from 'int' to 'char'
:\dvlp\test1\test1\test1.cpp(12): warning C4309: '=' : truncation of constant value

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

all i whant to say that char is not int,

Actually, char is just a small int whose range of values is +/- 127, see the header file limits.h Look at any standard ascii chart and you will see that every printable character has an int value.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Your compiler should have produced errors on line 4 because '50' is an invalid character. Line 5 is ok becuse it does not contain single quotes like like 4.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Then you will need to post more code to show us the entire *.cpp file. Otherwise you are just wasting our time.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

My guess is that you failed to include <string> header file and/or code the using std::string statment.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It usually takes a long long time for my temper to come to a boil -- for example I can work for weeks on a computer programming problem. For others, it doesn't take so long, I once trashed a compter because it wouldn't go back together the way I took it apart (I smashed it all over my concrete patio).

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 3 is wrong because std::wstring is declared in <string> header file If you want your own class then put it in a different namespace.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You need to post the code you wrote if you expect anyone to answer your questions.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The program is attempting to access non-existant table values. Lets assume a.length() == 10, then when i == 10 the statement table[i][0] is out-of-bounds because there is no element table[10][0]. Arrays are numbered 0 to but not including the upper-bounds of the array, in this case 0 1, 2, 3, 4, 5, 6, 7, 8, and finally 9. There is no 10th element. If you say your program works with 1000 then it works only by coincidence, not because its correct.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here is a code snippet I wrote some time ago, maybe it will help you with your question. As for the sub-directory question, see the example in my code snippet -- you have to test for them.

The code snippet was written in c++, so just ignore the code you may not understand and concentrate on the loops.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The where clause is incorrect.

WHERE Member.MemberID = (@MemberID) AND Rentals.MemberID = Member.MemberID

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

How much do you already know how to do? Do you know how to open a file and read it one word at a time? (A word is all the characters between spaces). Have you tried to code that program yet? If not, you should.