Multisensory techniques are frequently used for students with Learning Disabilities (LD) and include teaching strategies and materials that stimulate learning by enabling students to use some or all of their senses to:
Gather information about a task;
Link information to ideas they already know and understand;
Perceive the logic involved in solving problems;
Learn problem-solving steps;
Understand relationships between concepts; and
Learn information and store it for later recall.
Students with LDs typically have learning differences in one or more areas of reading, writing, math, listening comprehension, and expressive language. Multisensory techniques enable students to use their personal areas of strength to help them learn. They can range from simple to complex, depending on the needs of the student and the task at hand.
Learning Style Tests http://www.engr.ncsu.edu/learningstyles/...
http://www.scholastic.com/familymatters/...
http://homeworktips.about.com/od/homewor...
http://www.usd.edu/trio/tut/ts/style.htm...
Monday, May 24, 2010
In c++, how do I check if file length is zero?
I am doing a quiz project for the school exam. I have to check if file length of a file is zero ( concept of files). Can I use tellg() ?
I am implementing it in a class .Then I use if() statement to check if file length of a file which stores the quiz questions is zero( i.e there are no questions). If it is zero Then I invoke another function asking the user to input questions first.
Here should i use tellg() to check if there are no questions in the file.
P.s: I don't want it to be too complex...as I've been learning c++ only from june 2006
In c++, how do I check if file length is zero?
This page seems to have what you want.
Reply:May be my blog helps you. I have some code related to file handling in C++ at http://codesbyshariq.blogspot.com
Reply:you can use fstat to check if a file exists. it returns -1 if the file does not exist.
this function also exists on windows.
Reply:Use this method:
======================================...
#include %26lt;fstream%26gt;
int FileSize(const char* sFileName)
{
std::ifstream f;
f.open(sFileName, std::ios_base::binary | std::ios_base::in);
if (!f.good() || f.eof() || !f.is_open()) { return 0; }
f.seekg(0, std::ios_base::beg);
std::ifstream::pos_type begin_pos = f.tellg();
f.seekg(0, std::ios_base::end);
return static_cast%26lt;int%26gt;(f.tellg() - begin_pos);
}
======================================...
Drawback: If the file size is bigger than what int can hold, this method won't work, but in your case, you will be using it to check whether file size is 0, so it will work fine.
If you want to eliminate the limitation of int datatype, and if you are using Visual C++ compiler, then you can use the following function:
======================================...
#include %26lt;sys\types.h%26gt;
#include %26lt;sys\stat.h%26gt;
__int64 FileSize64( const char * szFileName )
{
struct __stat64 fileStat;
int err = _stat64( szFileName, %26amp;fileStat );
if (0 != err) return 0;
return fileStat.st_size;
}
======================================...
I am implementing it in a class .Then I use if() statement to check if file length of a file which stores the quiz questions is zero( i.e there are no questions). If it is zero Then I invoke another function asking the user to input questions first.
Here should i use tellg() to check if there are no questions in the file.
P.s: I don't want it to be too complex...as I've been learning c++ only from june 2006
In c++, how do I check if file length is zero?
This page seems to have what you want.
Reply:May be my blog helps you. I have some code related to file handling in C++ at http://codesbyshariq.blogspot.com
Reply:you can use fstat to check if a file exists. it returns -1 if the file does not exist.
this function also exists on windows.
Reply:Use this method:
======================================...
#include %26lt;fstream%26gt;
int FileSize(const char* sFileName)
{
std::ifstream f;
f.open(sFileName, std::ios_base::binary | std::ios_base::in);
if (!f.good() || f.eof() || !f.is_open()) { return 0; }
f.seekg(0, std::ios_base::beg);
std::ifstream::pos_type begin_pos = f.tellg();
f.seekg(0, std::ios_base::end);
return static_cast%26lt;int%26gt;(f.tellg() - begin_pos);
}
======================================...
Drawback: If the file size is bigger than what int can hold, this method won't work, but in your case, you will be using it to check whether file size is 0, so it will work fine.
If you want to eliminate the limitation of int datatype, and if you are using Visual C++ compiler, then you can use the following function:
======================================...
#include %26lt;sys\types.h%26gt;
#include %26lt;sys\stat.h%26gt;
__int64 FileSize64( const char * szFileName )
{
struct __stat64 fileStat;
int err = _stat64( szFileName, %26amp;fileStat );
if (0 != err) return 0;
return fileStat.st_size;
}
======================================...
How can you make c++ program end itself?
Whenever a c++ program that I make ends, no matter whether it is by using "return" or "exit(0)", it always displays, "Press any key to continue" before the window closes itself. Is there a way to get rid of this message and have the window close itself without having to press a key?
I am just learning c++ and I haven't been able to find the answer to this question anywhere else. I've got Microsoft Visual Studio.net 2003.
Thanks
How can you make c++ program end itself?
this is a default benefit provided by ms. otherwise u need to use getch() to get the output on ur screen or press alt+f5.
if u want to remove it there is pragma supress. but to get upto that point u need to kow a lot. till then keep suffering. :)or use any other compiler like turbo c++
Reply:Miscrosoft Visual studio provide this facility by default .. if u wan to change browse seetings ..if u can't chnage it use other compilers like borland or turbo ..well ur learning ..i think these complilers will make u sense of Basics also .
Reply:use getch()
that shld be fine acc to me.
liama-song
I am just learning c++ and I haven't been able to find the answer to this question anywhere else. I've got Microsoft Visual Studio.net 2003.
Thanks
How can you make c++ program end itself?
this is a default benefit provided by ms. otherwise u need to use getch() to get the output on ur screen or press alt+f5.
if u want to remove it there is pragma supress. but to get upto that point u need to kow a lot. till then keep suffering. :)or use any other compiler like turbo c++
Reply:Miscrosoft Visual studio provide this facility by default .. if u wan to change browse seetings ..if u can't chnage it use other compilers like borland or turbo ..well ur learning ..i think these complilers will make u sense of Basics also .
Reply:use getch()
that shld be fine acc to me.
liama-song
An example of iTunes SDK implementation in C or C++?
I'm trying to control iTunes from a C program, and the simpler way seems to be through iTunes SDK, but I lack the knowledge to do so on my own (just begun learning C). Could someone provide me with sample code, or a better way to achieve this?
Thanks in advance.
An example of iTunes SDK implementation in C or C++?
You really might want to learn C++ first. The SDK will present examples to you, and an API. If you cannot understand it, that means you don't have the prerequisite knowledge to work with it. No, we cannot help you with that. If we present code, you'll give us a deer-in-the-headlights look because you don't know C.
Reply:Believe me it is complex. Why do not you contact a C++ expert?
Try http://expert.myitcareer.org/
Thanks in advance.
An example of iTunes SDK implementation in C or C++?
You really might want to learn C++ first. The SDK will present examples to you, and an API. If you cannot understand it, that means you don't have the prerequisite knowledge to work with it. No, we cannot help you with that. If we present code, you'll give us a deer-in-the-headlights look because you don't know C.
Reply:Believe me it is complex. Why do not you contact a C++ expert?
Try http://expert.myitcareer.org/
Recommended C++ Compiler for beginners?
I want to start learning C++ programing, what compiler can you recommend me?
PS - I use Windows XP 64-bit, so just recommend me a working compiler for the operating system.
Thank You
Recommended C++ Compiler for beginners?
GCC has the advantage of being pretty good in adhering to standards, but if you're used to working under Windows, it may be a bit hard to get used to. You can download it here:
http://gcc.gnu.org/releases.html
Dev-C++ is used quite often, I've seen many people asking questions about it on this forum. You can download it here:
http://www.bloodshed.net/download.html
And then there's Microsoft Visual Studio C++ 2005 Express Edition. This edition is free but has its limitations (compared to a professional edition); on the other hand, if you're a beginning programmer, you won't run into those limitations very quickly. You can download it here:
http://msdn2.microsoft.com/en-us/express...
Look for C++, and don't accidentally download C#; that's an entirely different language altogether!
Reply:GCC
http://gcc.gnu.org/
Reply:I personally used Turbo C complier. Its very good for beginners.
You can easily identify the errors during compilation, i am sure you will love it.
You can download it here.
http://www.pitt.edu/~stephenp/misc/downl...
PS - I use Windows XP 64-bit, so just recommend me a working compiler for the operating system.
Thank You
Recommended C++ Compiler for beginners?
GCC has the advantage of being pretty good in adhering to standards, but if you're used to working under Windows, it may be a bit hard to get used to. You can download it here:
http://gcc.gnu.org/releases.html
Dev-C++ is used quite often, I've seen many people asking questions about it on this forum. You can download it here:
http://www.bloodshed.net/download.html
And then there's Microsoft Visual Studio C++ 2005 Express Edition. This edition is free but has its limitations (compared to a professional edition); on the other hand, if you're a beginning programmer, you won't run into those limitations very quickly. You can download it here:
http://msdn2.microsoft.com/en-us/express...
Look for C++, and don't accidentally download C#; that's an entirely different language altogether!
Reply:GCC
http://gcc.gnu.org/
Reply:I personally used Turbo C complier. Its very good for beginners.
You can easily identify the errors during compilation, i am sure you will love it.
You can download it here.
http://www.pitt.edu/~stephenp/misc/downl...
C++, Getting Started?
I'm a computer science graduate and I'd like to start learning C++, I know about a ton of other languages but my university didn't teach it
where would be a good place to start? and is there a runtime environment I need to download?
C++, Getting Started?
%26gt; where would be a good place to start?
Start by getting a decent C++ book. Google also helps. http://accu.org/index.php/book_reviews?u... is a list of book reviews by ACCU, which checks for technical accuracy. I think C++ Primer by Lippman and Accelerated C++ by Koenig are very good choices. If you have plenty of prior programming experience, then Accelerated C++ might be a good choice for you.
Also keep in mind the C++ FAQ http://www.parashift.com/c++-faq-lite/ . And http://forums.devshed.com/c-programming-... which tells you how to deal with some common basic tasks like file opening and string%26lt;-%26gt;numeric conversion. And cppreference.com because you will want to know what the different parts of the standard library are.
%26gt; and is there a runtime environment I need to download?
C++ gets you a native binary for your OS, so you don't need a runtime environment. However, you do need the set of tools to make a C++ binary. They are referred to collectively as the C++ compiler. Microsoft has Visual C++, which runs only on Windows. Otherwise, it is gcc, which is available for linux/*nix, Macs, and Windows (under the name MinGW).
You'll need a C++ compiler. You most likely will want an IDE like Code::Blocks, wxDev-C++, or Visual Studio if you are using Visual C++. Macs have Xcode. Linux have Kdevelop, Anjuta, etc. You could also use a plain text editor in place of an IDE.
Reply:there are many examples available in the tutorial in the editor.
Or go to online tutorials.
Or buy the balagurusamy book for beigneers and The C++ Programming Language. by Bjarne Stroustrup
Reply:surely a CS grad took C and Pascal, so get a Borland C++ compiler and get a good book at B%26amp;N. That plus 24 hrs (SAMS book) should do it. It's not that hard to get started.
Reply:Check this site out http://cpp-home.com. I too am a computer science graduate and this site was very helpful for finding tutorials, example code, and getting answers to questions in their forum while I was in school.
where would be a good place to start? and is there a runtime environment I need to download?
C++, Getting Started?
%26gt; where would be a good place to start?
Start by getting a decent C++ book. Google also helps. http://accu.org/index.php/book_reviews?u... is a list of book reviews by ACCU, which checks for technical accuracy. I think C++ Primer by Lippman and Accelerated C++ by Koenig are very good choices. If you have plenty of prior programming experience, then Accelerated C++ might be a good choice for you.
Also keep in mind the C++ FAQ http://www.parashift.com/c++-faq-lite/ . And http://forums.devshed.com/c-programming-... which tells you how to deal with some common basic tasks like file opening and string%26lt;-%26gt;numeric conversion. And cppreference.com because you will want to know what the different parts of the standard library are.
%26gt; and is there a runtime environment I need to download?
C++ gets you a native binary for your OS, so you don't need a runtime environment. However, you do need the set of tools to make a C++ binary. They are referred to collectively as the C++ compiler. Microsoft has Visual C++, which runs only on Windows. Otherwise, it is gcc, which is available for linux/*nix, Macs, and Windows (under the name MinGW).
You'll need a C++ compiler. You most likely will want an IDE like Code::Blocks, wxDev-C++, or Visual Studio if you are using Visual C++. Macs have Xcode. Linux have Kdevelop, Anjuta, etc. You could also use a plain text editor in place of an IDE.
Reply:there are many examples available in the tutorial in the editor.
Or go to online tutorials.
Or buy the balagurusamy book for beigneers and The C++ Programming Language. by Bjarne Stroustrup
Reply:surely a CS grad took C and Pascal, so get a Borland C++ compiler and get a good book at B%26amp;N. That plus 24 hrs (SAMS book) should do it. It's not that hard to get started.
Reply:Check this site out http://cpp-home.com. I too am a computer science graduate and this site was very helpful for finding tutorials, example code, and getting answers to questions in their forum while I was in school.
Which is the best book to start learning data structures and algorithms? simple would be best for me!?
I am new to computer field. And I am currently learning C++.
I heard ,it is better to learn algorithms to do better in this field. I started with Introduction to Algorithms
by Thomas H. Cormen, Charles E. Leiserson, and Ronald L. Rivest.
I liked the book. But I found it difficult to understand. Can someone help me out with some simpler book for algorithms.
Which is the best book to start learning data structures and algorithms? simple would be best for me!?
Hi Devi,
Learning algorithms and learning a new programming language are two orthogonal items. But since you are learning both together it would be nice if you could get hold of a Data-structures book that implements algorithms in C++.
Cormen book is supposed to be one of the best books on the subject. Knuth's books on algorithms are also highly regarded. I have personally found Sahni's book "Data Structures, Algorithms and Applications in C++" to be good. I believe that this book is also available as an Indian edition.
Reply:Well programming is a ton of algorithms, but some algorithms in most books are the more advanced type. I always recommend beginners start with a good beginner "syntax" book, then a good "programming practices" book and last a good "learn to debug" book.
The beginner syntax book should be something like a "Sams teach yourself" series or my favorite the visual blueprint series.
The good programming practices/debugging book should be something like McConnells "Code Complete 2" which is the best book on coding practices/debugging I have ever seen.
Then lastly any real debugging book which has simple examples in your language of choice usually works. If you must have a book title, you could try "the science of debugging" by Coriolis publishing. It is an older book and pretty cheap these days, but has some great stories about debugging mishaps and how to prevent bugs.
I have included some titles that you will find the most useful, not only to learn but also as reference later.
Hope they come in handy. Enjoy!
garden state
I heard ,it is better to learn algorithms to do better in this field. I started with Introduction to Algorithms
by Thomas H. Cormen, Charles E. Leiserson, and Ronald L. Rivest.
I liked the book. But I found it difficult to understand. Can someone help me out with some simpler book for algorithms.
Which is the best book to start learning data structures and algorithms? simple would be best for me!?
Hi Devi,
Learning algorithms and learning a new programming language are two orthogonal items. But since you are learning both together it would be nice if you could get hold of a Data-structures book that implements algorithms in C++.
Cormen book is supposed to be one of the best books on the subject. Knuth's books on algorithms are also highly regarded. I have personally found Sahni's book "Data Structures, Algorithms and Applications in C++" to be good. I believe that this book is also available as an Indian edition.
Reply:Well programming is a ton of algorithms, but some algorithms in most books are the more advanced type. I always recommend beginners start with a good beginner "syntax" book, then a good "programming practices" book and last a good "learn to debug" book.
The beginner syntax book should be something like a "Sams teach yourself" series or my favorite the visual blueprint series.
The good programming practices/debugging book should be something like McConnells "Code Complete 2" which is the best book on coding practices/debugging I have ever seen.
Then lastly any real debugging book which has simple examples in your language of choice usually works. If you must have a book title, you could try "the science of debugging" by Coriolis publishing. It is an older book and pretty cheap these days, but has some great stories about debugging mishaps and how to prevent bugs.
I have included some titles that you will find the most useful, not only to learn but also as reference later.
Hope they come in handy. Enjoy!
garden state
Subscribe to:
Posts (Atom)