|
Well, what to say...Good luck and enjoy the experience.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
priyanka narkhede wrote: for front end in ASP and back end in C#
So, that's why you post your question in the C++ forum. That makes sense, everybody knows that C++ is a mix between ASP and C#
|
|
|
|
|
Hmmmm - now what[^] websites[^] could POSSIBLY help you...
Open your eyes - maybe your mind will follow.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Please let me know how can i use CCheckListBox class bcos when i tried to use im getting Debug Assertion failed...
when i had a look it was mentioned that this class is owner drawn...
So please let me know how can i use it...
|
|
|
|
|
|
thanks for ur link.....it"s working.....
|
|
|
|
|
OIOIC is a completely new object-oriented mechanism for the C programming language.
Please download the "OIOIC-Primer-2nd-Edition.tar.gz" (an English version in it.)
http://code.google.com/p/oioic/downloads/list
Welcome your advice!
Using OIOIC, you can describe the flower, birds, grass, insects, trees, houses ...
Using OIOIC, you can describe the elements, atoms, protons, electrons ...
Using OIOIC, you can describe the earth, the sun, the Milky Way galaxy, collapsar ...
Using OIOIC, you can describe ...
1. OIOIC perfectly supplies the gap of object-oriented technology for the C programming language;
2. OIOIC perfectly solved the multiple inheritance problem in the Software World;
3. OIOIC perfectly objectivizes multithreading access control of object;
4. OIOIC unifies the norm of components in the Software World;
5. OIOIC unifies the structure of code tree in the Software World;
6. OIOIC unifies the thinking of object-oriented programming in the Software World;
7. OIOIC unifies all advanced programming languages in the Software World, to make the C programming language as the preferred.
|
|
|
|
|
Please don't spam the message boards.
|
|
|
|
|
I voted to remove your message yesterday, and I'm voting again today.
And apparently you're spamming other message boards.
If this is an advert for a commercial product, you should be paying codeproject properly to put it in front of out eyes.
If it is a project you've created, and want other people to know about, how about writing an article about it? Show us a useful application. Show us a real world problem this solved.
We're used to alphabet soup of multiletter acronyms, but they're usually only 3 letters long.
As for "...you can describe the flower, birds, grass, insects, trees, houses...", it sounds like Poetry SDK to me, and we've had that for 1000's of years.
If this is your result of years of hard work, I congratulate you, but spamming our message boards is not the way to make friends and influence people.
I wish you luck in the correct venue(s),
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Iain Clarke wrote: Poetry SDK
Wonderful.
Welcome again (and again) in the, well you know which one, list [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
pervise.zhao wrote: Welcome your advice!
My advice: change your career, there're always job opportunities at McDonald's.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I am using QNX IDE.
I need to create a file which is exactly 2112 bytes.T.he data written to the file must be of type char(in Hexadecimal format.
I am trying following code.
#include "stdio.h"
#include "conio.h"
#include<stdlib.h>
#include<fstream.h>
void main()
{
FILE* fs;
fs=fopen("c:\\RajC\\randomF.txt","w");
srand(255);
for(unsigned char i=0;i<255;i++)
{
printf("%c\t",rand());
fprintf(fs,"%x\t",rand());
}
getch();
}
but the output of the above program gives me a file of 6.08KB,whereas I need just a filesize of 2112bytes.
I need to use this file for testing on a hardware.
*/
Can anyone help me.
Thanks in advance.
Regards,
Purusottam Mishra
Purusottam Mishra
Systems Executive
|
|
|
|
|
Writing a single char takes 1 byte. including '\t' tabs. You are running the loop 255 times. So if you just print 1 char in the loop, the file size becomes 255 bytes. if you print the hex value, it defers based on the number it generates. May be you can format the string to a standard size and calculate the size accordingly. Remember the tab takes 1 byte.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
If you are able to call Windows APIs, you can use SetFilePointer followed by SetEndOfFile .
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I strongly suggest you to revise your requirements.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes sir.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
[military tone]
Stand easy!
[/military tone]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
This should work:
#include <io.h>
#include <fcntl.h>
void main()
{
int fd=open(file-path,O_RDWR|O_BINARY|O_CREAT|O_TRUNC);
if (fd != -1)
{
const size_t numBytes = 2112;
unsigned char buffer[numBytes]={0};
const int x = write(fd, buffer, numBytes);
close(fd);
}
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks a lot for the reply.
But can u gimme a C++ style solution,i.e. using fstream.
I am trying it this way:
void Create_Page_File()
{
int iCount;
char wbuf[PAGESIZE];
int rand_no;
memset (wbuf, 0, PAGESIZE);
ifstream infile("/tmp/TestData.bin");
ofstream outfile("/tmp/TestData.bin");
for( iCount = 0; iCount < PAGESIZE; iCount++ )
{
rand_no = rand( );
wbuf[ iCount ] = ( rand_no % 0xff );
outfile.write( &( wbuf[ iCount ]), 1 );
cout<< wbuf[iCount]<<" ";
}
}
But the resulting file I am getting is in character format,nd not hexadecimal.
Please Help me.
Thanks and regards,
Purusottam Mishra
Systems Executive
|
|
|
|
|
std::ofstream a("b.b", std::ios::binary|std::ios::trunc);
a << std::string(2112, (char)0);
<div class="ForumSig">Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p</div>
|
|
|
|
|
This is not working.
Can you please make it in detail.
Actually I am just a newbie.
Thanks for the reply.
Purusottam Mishra
Systems Executive
|
|
|
|
|
Raj-Ekoham DwitiyoNasti wrote: This is not working
It creates a file called b.b in the current directory which is exactly 2112 bytes in length. Want a different filename? Then change it in the constructor. Want a different file length? Then change the length (2112 in this case) in the string constructor
Otherwise, what do you mean by 'not working'?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I mean that the file b.b has its contents as "char" and not Hexadecimal.
The previous example that u'd given me(C Style), the fwrite() converts the char data to Hexadecimal implicitly.
for(iCount=0; iCount<PAGESIZE; iCount++)
{
rand_no = rand();
wbuf[iCount] = (rand_no % 0xff);
fwrite(&(wbuf[iCount]),sizeof(char),1,fp);}
Is there any way to do so using C++.
Thanks and Regards,
Purusottam Mishra
Systems Executive
|
|
|
|
|
Raj-Ekoham DwitiyoNasti wrote: I mean that the file b.b has its contents as "char" and not Hexadecimal.
There's no difference between 'char' and 'hexadecimal' - they're all just numbers. The only difference with char is that the numbers are understood to map onto characters.
Try this - and look at the file contents after it's run - they're as random as you want.
std::ofstream a("b.b", std::ios::binary|std::ios::trunc);
std::generate_n(std::ostream_iterator<char>(a), 2112, rand);
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|