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

fscanf() reads dataa from the file directly into a variable, it is not necessary to do other transfers. The parameters to fscanf() must all be pointers to your program's variables so that fscanf() can change their values. In your example you need to do it like this:

char temp[80]; // the tag name
int rows;
int columns;
// etc for each variable

fscanf(infilep, "%s: %d\n",  temp, &rows)

In the above you see that char arrays are always passed as pointers so there is no need to use & operator on them. Another way to do it, if you like using &, is like this: &temp[0], which creates a pointer to the first character in the array. Either way of coding it is correct.

The problem with using fscanf() like the above is that you can't scramble the lines in the fine and still get the same results. Once you write the program the file format must be written in stone. If you take my original suggestion then the lines of the file can be in any order you wish, the program is not dependent on the file order and vice versa.

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

You will find the information in any ascii chart, such as this one. Since C/C++ and other languages represent letters are numbers there is no conversion from one to the other except for typecasting. If you want to display the letter 'S' all you do is typecast it to char, for example

int letter = 83;
cout << (char)letter;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here is a blog that may help you. You might use a different compiler, such as Intel. The blog also discusses some other options.

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

Did you build debug or release version?

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

That is a common file format for a *.ini file used by many MS-Windows programs that contain startup information. You can't store the data directly into a variable using fscanf(). Instead you have to call fgets() to get a line of text, find the colon in the line, then call a series of if statements to use strcmp() on the first part of the text, commonly =called tags. Once a tag name is found you assign the value to the appropriate value. For example, if the first line is read from the file

char line[80] = "rows: 5"; // this is read in a loop from the file
char* ptr = strchr(line,':');
*ptr++ = '\0';
if( strcmp(line,"name") == 0)
   name = atol(ptr);
else if( strcmp(line,"another name) == 0)
   AnbotherName = atol(pointer);

 // etc. etc with more if statements
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The size of long double is compiler-dependent, not operating system dependent. What compiler did you use on MS-Windows? I know Microsoft VC++ does not support long double -- the name is recognized the but the is the same as double. MinGW on MS-Windows (Code::Blocks) produces the same results that you posted. Why 12 I can only guess is sizeof(long) + sizeof(double).

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

Chrome is ok too.

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

Patrick: contact your local travel agency, they should be able to help you with that.

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

You need to post function main() that just uses your template to illustrate the problem. That way we can compile and test is ourselves. Right now we have no clue how you are using that template.

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

Kindly mark this thread closed if you are satisfied with it.

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

The reason for the restriction is to keep bots from spamming people via PM. [edit]Sorry, Mike already said that.

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

I was thinking of "Power to Affect Someone's Reputation Positively".

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

Correct! BWT: My name is NOT "sir". Only my dad was "sir" and people who don't actually work for a living. I prefer being called either AD or Mel.

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

why the op is using an array of std::strings is beyond me, why not just a single string and index it as normal

std::string alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 

newChars[j]=alphabet[j];
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If you have not started anything yet then use libcurl, here is a thread about it. There are a lot of other threads on this topic so you need to do some googling to find them. You can also get free libCurl download by googling. I can't answer detailed questions about it because I don't have any experience with it, I just know its a very popular library.

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

Theoritically, yes, but no one has thousands of rep points. Look at my profile, it has one of the hightest on DaniWeb yet I only affect +14 or -3 points, depending on whether I vote up or down and leave a comment. The reason for such a small amount is because we thought I and others like me should not have to power to completely destroy someone's rep with just one vote. Before Dani changed the system a year or so ago I refused to downvote anyone because he/she would never be able to recover from it. Dani implemented a rep system that is today a lot more fair to everyone than it was two years ago.

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

most rep points are produced by members voting a post with the up or down arrow and leaving a comment. No comment means no points given. Other rep points are given by the system after certain intervals of posting, new members are given 10 points. The amount of points you can receive depends on the rep points that the member himself/herself has acquired. If you want to find that out just click the member's avatar and a screen will appear that will give you that information as well as a lot of other info about the member.

deceptikon commented: Good answers. :) +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What's the purpose of the return value on line 49 when the program discards it? That function is not doing its intended purpose according to instruction #4.

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

3^2 is 9, not 32. Where does the 32 come from?

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

I think what you are looking for is the source code for the *nix like tail program. See this thread for assistance

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

how are you getting the webpage into your program? Sockets? something else?

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

Put $5,000USD in my PayPal account and I'l do your homework for you. Otherwise, if you don't want to do that, I guess you'll just have to solve it yourself.

How do you get 32, 42 and 52 from that data?

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

you don't need malloc() if you have static array sizes. Post the entire loop(s) that you tried, not just one line out of it(them).

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

how about month year days

What about it?

anyone??

Don't be so impatient, people are probably busy with their lives doing other things. Don't expect immediate answers on forums.

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

The function passed to _beginthread() must be either a C/C++ standard global function or a static method of a class. You can't pass non-static class members because they do not exist at compile time. Make DrawLines() a static method of the class and it should compile. This is not peculiar to MFC but a requirement of all c++ programs.

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

I don't have your compiler (Turbo C) so I can't test your program, but the cause is normally because you are attempting to write more to the screen than the screen can hold, so the operating system scrolls the screen up to make room at the bottom to add more text. Suggest you start commenting out some of those cprintf() lines until you find where the screen stops scrolling up, then you will know what line is causing it.

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

cl.exe can only be run on Windows 2000, Windows XP and Windows Server 2003 operating systems

That's probably an old link -- it also runs on all current versions of MS-Windows. You don't have to use vc++, there are other options such as the popular Code::Blocks with MinGW compiler.

Any GUI library will work, you can even make one as a console program. It all depends on how fancy you want to make your IDE.

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

Any ideas out there of how to start

Yes, read the previous posts and links in this thread.

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

not to worry, happens to everyone.

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

newChars[j]= *alphabet[j].c_str();

Too complicated, you don't need to use c_str()

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

read previous posts and links then write it yourself.

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

strcpy() is wrong because it takes two character arrays as arguments, not two single characters

Your second example on line 17 is correct way to do it. But you didn't really say what the expected output should be so I can't say whether its right or wrong.

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

Can I send to u a private message

Please read my signature -- I don't accept private messages.

If you know the size of the matrixes then you don't need pointers. Just call rand() to fill the matrices with random numbers. Here is another thread that may help you.

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

what exactly do you mean? a matrix with random number of rows and columns? a matrix that contains random numbers? Both?

In order to work with a matrix with random number of rows and columns you need to know how to work with pointers, each dimension requires one star, so in a 2d matrix you would have int** array, after that call malloc() to allocate each dimension of the array. Some of the code below may now compile with older C compilers.

int** matrix = 0;
int i;
const int rows = 5;
const int cols = 10;

matrix = (int **)malloc(rows * sizeof(int *)); // allocate rows

// now allocate the columns
for(i = 0; i < rows; i++)
   matrix[i] = (int *)malloc(rows * sizeof(int));
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Are you studying a cmake tutorial?

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

nmake.exe is a Microsoft product, not supported by MinGW. If you look in the MinGW bin folder you will see mingw32-make.exe, and if you give it --help the program will display a short list of all the commands you can give it.

mingw-make.exe can not use the makefile with *.msc extension because that's for the Microsoft compiler. Look in the zlib folders and find a makefile for mingw or gnu

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

Same problem reported here yesterday

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

you must always ship the zlib1.dll with your program unless they provide a static-link library. You always have to put it in the same folder as your program or one of the folders listed in the PATH environment variable. The statement "during testing" is a little misleading.

If you have the source code to zlib1.dll then you can recompile it yourself to generate the static link library.

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

I just got the same error message when I tried to upload a file. Also, why can't I upload *.cpp files (The filetype you are attempting to upload is not allowed)

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

even vc++ 2012 which was just released does not support long double.,

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

ascii value is not related to operator precedence.

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

Is Dragon Nest from Nexon safe to download? Windows 7 tells me its unsafe and won't run the downloaded file.

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

Your program is not checking for the existance if the file, it just assumes the file always exists. You need to check for NULL return from fopen() and do nothing if NULL was returned.

BTW: Don't call rewind() after fopen() because its a waste of effort, the file pointer is already at the beginning of the file.

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

In the loop on line 31 you are displaying all the letters 'A' through 'T' on the same line. What you need to do is put a line break when the loop counter reaches the number of columns input on line 20. You will probably need two counters, one that counts from 0 to ncols and another that counts from 'A' to 'T' as it is doing now

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

repartition and reformat the hard drive.

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

Here is an example I wrote in 2009 that uses Sqlite in a c++ program. I don't know about the c++ wrappers you mentioned because I have not used any of them.

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

Is creature.h spelled "creature.h" or "creatures.h" -- your program contains both spellings.

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

If the C source code file is written in C and I can't compile it in a C++ compiler (so I'm told)

They told you wrong.

There is no problem at all mixing C and C++ files in the same program, I've done it several times. It's all in the file extension, the compiler sees a *.c and knows that it has to compile it as C code, and if it sees *.cpp extension the compiler compiles it as c++ code. No other special things have to be done to the source files or the compiler flags. sqlite.h already contains the preprocessor flags needed to tell the compiler that all the functions are written in C instead of C++ so that the header file can be included in c++ programs.

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

Not only are you a year late with that answer but the answer is just wrong. There is no guarentee that the letters are separated by a value of 32. It all depends on the character set used. Use the standard function toupper() and tolower() to convert from upper to lower or vice versa.