dev-cpp-users Mailing List for Dev-C++ (Page 338)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: manilius <man...@gm...> - 2003-07-31 08:11:21
|
Hi
=20
> Ok, the idea was to create all the possible combinations
> (up to 100
> characters long) using all the avalible characters in the
> ascii character
> set from 32 (space) to 126 (~) inclusive. When we try to
> increment '~' we
> end up getting a space and we increment the next character
> in the string and
> applying the same overflow rule.
Okay, that would be one way to do it, but it does involve a lot of =
string
manipulation (check a character and change it) which is not needed with
recursion. Is there a special reason you want to use your "overflow
algorithm"?
If you want more characters with the recursion example I sent you, just =
add
them to the character table:
for( int i=3D0; i<92; i++) CharacterTable.push_back(' '+i);
should include all characters you want.
If you need zero-terminated strings, you can use the function c_str() of =
the
std::string class to create them.=20
But again: There is no way to create a list of all possible strings with =
the
length of 100. You have
(# of possible charcters)^length of the string=20
possibilities. This results in a huge number (try calculate 92^100 :)=20
ciao...
...manilius
|
|
From: Daniel G. <sp...@ho...> - 2003-07-31 07:07:10
|
Do you get a connection to the database? If so can you perform a simple SQL query and output to a messagebox to test? >From: "Ed Cottrell" <em...@to...> >To: "'Dev-C++ users'" <dev...@li...> >Subject: [Dev-C++] OT: Connecting to FoxPro databases with a DSN >Date: Wed, 30 Jul 2003 16:26:37 -0400 > >Hi all - > >I know this is not a Dev-C++ post, but I'm a little new to C and am >desperate for help. I have to convert a Visual Basic program (which I >wrote) >to C or C++, the primary purpose of which is to collate information from a >bunch of databases - currently 12 Foxpro and 1 MySQL - without using DSNs. > >What I need is for somebody to point me to a resource on how to work with >the Foxpro ODBC driver from a C/C++ program; the tutorial on Microsoft's >MSDN site compiled (after some tweaks), but doesn't produce any output, and >I can't find seem to find the errors. > >Many thanks! > >-Ed > > >President >Topsail Consulting, Inc. >em...@to... >http://www.topsailconsulting.com > >Phone/Fax: 770-719-3332 >Cell: 404-328-8503 >155 Shamrock Drive >Fayetteville, GA 30215-2810 > > > > > >------------------------------------------------------- >This SF.Net email sponsored by: Free pre-built ASP.NET sites including >Data Reports, E-commerce, Portals, and Forums are available now. >Download today and enter to win an XBOX or Visual Studio .NET. >http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________________ On the move? Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile |
|
From: w.y. <yok...@be...> - 2003-07-31 05:37:56
|
David McKen wrote:
>
> What is this supposed to do?
> (I tried this example program)
>
> #include <stdio.h>
>
> int main()
> {
> int var;
> var = 5;
> printf("%p", &var);
> return 0;
> }
>
> Output:
> 00405020
That's the adress in memory, given in hexadecimal, on your computer
where
the variable called "var" is located at the time you ran your program.
cout << &var;
does the same thing in C++
On my machine printf gives 0022FF6C and cout gives 0x22ff6c.
|
|
From: David M. <ci...@ya...> - 2003-07-31 03:39:50
|
----- Original Message -----
From: "Esteban Valverde" <est...@ho...>
To: "dev-cpp" <dev...@li...>
Sent: Tuesday, July 29, 2003 2:37 PM
Subject: [Dev-C++] Manipulator
> Hi, which is the ostream manipulator to printf the
direction of a varible
?
> In C it can be obtained by the next sentence...
>
> int var;
> ..
> printf("%p", &var);
What is this supposed to do?
(I tried this example program)
#include <stdio.h>
int main()
{
int var;
var = 5;
printf("%p", &var);
return 0;
}
Output:
00405020
>
> bye, Esteban
__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com
|
|
From: David M. <ci...@ya...> - 2003-07-31 03:34:30
|
Uh the way I was seeing it was that the recursion would
only go to a level
equal to the length if the string.
Ok, the idea was to create all the possible combinations
(up to 100
characters long) using all the avalible characters in the
ascii character
set from 32 (space) to 126 (~) inclusive. When we try to
increment '~' we
end up getting a space and we increment the next character
in the string and
applying the same overflow rule.
Here are some sections of the expected output:
gksdg
hksdg
iksdg
jksgd
kksgd
.....
|ksgd
}ksgd
~ksgd <-We have reached ~ so the next string will
have <space> and
we have to increment the next character.
lsgd <- Note that this is <space>lsgd
!lsgd
"lsgd
Things get interesting when this situation arises.
y~~~ju
z~~~ju
{~~~ju
|~~~ju
}~~~ju
~~~~ju
<sp><sp><sp><sp>ku <- <sp> = space
in this case we had 4 overflows to deal with
In case you are wondering I am looking for varible length
strings up to the
max (in this case 100).
I hope this makes things clearer. Also '++' works quite
well in incrementing
one character, my problem is with handling the overflow.
Signed
David Mcken
----- Original Message -----
From: "manilius" <man...@gm...>
To: "'Dev-C Mailing List'"
<dev...@li...>
Sent: Wednesday, July 30, 2003 4:54 PM
Subject: AW: [Dev-C++] Producing a endless list of strings.
> Hi,
>
> > Eventually I hope to use this to create strings at
least
> > 100 chars long (possibly 1000). Could someone tell me
if
> > 100 levels using recursion cause a stack overflow?
>
> Do I understand you correctly that you want to create a
list with every
> possible string of 100 or even 1000 characters?
> Even a list of all lower case strings with 10 letters
takes about 10^15
> bytes. You will definitely get a stack overflow :)
>
> But here is how you could do it:
>
> #include <iostream>
> #include <string>
> #include <vector>
> #include <stdlib.h>
>
> using namespace std;
>
> vector<char> CharacterTable;
>
> void CreateAllPossibleStrings(string String, int
RecursionLevel)
> {
> if(RecursionLevel > 0)
> {
> for(int i=0; i<CharacterTable.size(); i++)
>
>
CreateAllPossibleStrings(String+CharacterTable[i],RecursionLevel-1);
> }
> cout << String << endl;
> }
>
> int main(int argc, char *argv[])
> {
> // Init character table, only lower case letters in this
case
> for( int i=0; i<26; i++) CharacterTable.push_back('a'+i);
>
> // Create all strings, recursion depth is 2...try to
increase it :)
> CreateAllPossibleStrings("",2);
>
> system("PAUSE");
> return 0;
> }
>
> ciao...
> ..manilius
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET
sites including
> Data Reports, E-commerce, Portals, and Forums are
available now.
> Download today and enter to win an XBOX or Visual Studio
.NET.
>
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE:
http://www23.brinkster.com/noicys/devcpp/ub.htm
>
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
|
|
From: manilius <man...@gm...> - 2003-07-30 21:07:26
|
Hi,
> Eventually I hope to use this to create strings at least
> 100 chars long (possibly 1000). Could someone tell me if
> 100 levels using recursion cause a stack overflow?
Do I understand you correctly that you want to create a list with every
possible string of 100 or even 1000 characters?
Even a list of all lower case strings with 10 letters takes about 10^15
bytes. You will definitely get a stack overflow :)
But here is how you could do it:
#include <iostream>
#include <string>
#include <vector>
#include <stdlib.h>
using namespace std;
vector<char> CharacterTable;
void CreateAllPossibleStrings(string String, int RecursionLevel)
{
if(RecursionLevel > 0)
{
for(int i=0; i<CharacterTable.size(); i++)
CreateAllPossibleStrings(String+CharacterTable[i],RecursionLevel-1);
}
cout << String << endl;
}
int main(int argc, char *argv[])
{
// Init character table, only lower case letters in this case
for( int i=0; i<26; i++) CharacterTable.push_back('a'+i);
// Create all strings, recursion depth is 2...try to increase it :)
CreateAllPossibleStrings("",2);
system("PAUSE");
return 0;
}
ciao...
...manilius
|
|
From: Ed C. <em...@to...> - 2003-07-30 20:26:52
|
Hi all - I know this is not a Dev-C++ post, but I'm a little new to C and am desperate for help. I have to convert a Visual Basic program (which I = wrote) to C or C++, the primary purpose of which is to collate information from = a bunch of databases - currently 12 Foxpro and 1 MySQL - without using = DSNs. What I need is for somebody to point me to a resource on how to work = with the Foxpro ODBC driver from a C/C++ program; the tutorial on Microsoft's MSDN site compiled (after some tweaks), but doesn't produce any output, = and I can't find seem to find the errors. Many thanks! -Ed President Topsail Consulting, Inc. em...@to... http://www.topsailconsulting.com Phone/Fax: 770-719-3332 Cell: 404-328-8503 155 Shamrock Drive Fayetteville, GA 30215-2810 |
|
From: Graham D. <g.d...@nt...> - 2003-07-30 18:47:24
|
char* is more difficult, since there's a specific overload for it that prints a string. I suppose you could cast it to a long and print that. Bit ugly, though. char * str; cout << hex << reinterpret_cast<long>(str) << endl; By the way, my earlier answer could be even simpler: int var; cout << &var << endl; // still prints in hex. Graham Esteban Valverde wrote: >What a dummy !!! thanks... and what about char * ? > >char * str; >... >cout << hex << str > >doesn't works. > > >Esteban > > >----- Original Message ----- >From: "Graham Douglas" <g.d...@nt...> >To: "Esteban Valverde" <est...@ho...> >Sent: Tuesday, 29 July, 2003 16:24 >Subject: Re: [Dev-C++] Manipulator > > >cout << hex << &var << endl; > > > > > |
|
From: Graham D. <g.d...@nt...> - 2003-07-30 17:59:02
|
And now, written in C++ (no mucking about with arrays, pointers or
new/malloc):
#include <iostream> // NB: _not_ iostream.h
#include <string>
#include <vector>
using namespace std;
class str_misc
{
public:
istream& read(istream& is)
{
is >> str;
return is;
}
ostream& write(ostream& os) const
{
os << str;
return os;
}
private:
string str;
};
istream& operator>>(istream& is, str_misc& s)
{
return s.read(is);
}
ostream& operator<<(ostream& os, const str_misc& s)
{
return s.write(os);
}
int main()
{
vector<str_misc> str_ex(12);
cin >> str_ex[0];
cout << str_ex[0] << " Index = 0" << endl;
cin >> str_ex[1];
cout << str_ex[1] << " Index = 1" << endl;
cout << str_ex[0] << " repeat Index = 0" << endl;
cout << str_ex[1] << " repeat Index = 1" << endl;
system("PAUSE");
return 0;
}
dawood wrote:
> Can anybody let me know, why the below code is not working correctly.
>
> #include <iostream.h>
> #include <stdlib.h>
>
> int main()
> {
> struct str_misc {
> char* cstr;
> };
> str_misc str_ex[12];
> char* buf;
>
> cin>>buf;
> str_ex[0].cstr= buf;
> cout<<str_ex[0].cstr<<"index=0"<<'\n';
>
> cin>>buf;
> str_ex[1].cstr= buf;
> cout<<str_ex[1].cstr<<"index=1"<<'\n';
>
> cout<<str_ex[0].cstr<<" repeat index=0"<<'\n';
> cout<<str_ex[1].cstr<<" repeat index=1"<<'\n';
>
> system("PAUSE");
> return 0;
> }
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: <ten...@ne...> - 2003-07-30 17:58:45
|
First, I don't want to be exhaustive, here, but I say what I think right
know.
In a trial I did about filling areas of same color with one I selected
it crashed, in the one I checked the number of recursions performed in
the 57th, the function had seven parameters: two passed by value, two
were pointers and the other three passed by reference.
With a loop it didn't only work fine, but very faster (the loop version
filled a, say as any number, surface of 50 * 50 pixels in one minute and
some seconds, the loop version filled all the screen (800*640) in less
than a second).
I see hard how to do what you want recursively.
I would do a loop like this:
char list[1000][101]; <- I hope these are correctly done: 1000 strings
with 100 chars plus the null
for (int i = 0; i < number_of_strings; i++){
for (int j = 0; j < number_of_chars && list[i][j-1] != '\0'; j++){
list[i][j] = (the number you assign it as you want, as you calculated it
before or here I don't achieve to understand exactly what mean steps 2
and 3.)
if (list[i][j] == 127)
do the transformation you want.
} // second for
}//first for
P.D. - The access violations can be caused by the fact you don't
allocate memory for the pointers you use, if you use them as pointers,
not as statically allocated array, which is what I do inthis piece.
David McKen wrote:
>Ok, this is not a school assignment so please don't ask.
>
>I would like to produce a list of null terminated strings
>that I plan to use to test a hash function. Unfortunately I
>am a bit stumped as what would be the best way to create
>such a list.
>
>The algorithm is as follows:
>1. Start with a string containing only a space.
>
>2. Increment the first character in the string.
>
>3. If the value of the first character is 127 (DEL) then
>set it to 32 (space) and increment the next character
>(repeat this step if that character is 127).
>
>4. print out the string.
>
>5. goto step 2.
>
>I know, Recursion is screaming at me to use it.
>Problem is, how? I am getting stuck in the wind-up section.
>(That and the fact that Visual C++ is giving me access
>violations)
>
>My other question is, does anyone else know another way?
>Eventually I hope to use this to create strings at least
>100 chars long (possibly 1000). Could someone tell me if
>100 levels using recursion cause a stack overflow?
>
>Thanks in Advance
>David Mcken
>
>__________________________________________________
>Do you Yahoo!?
>The New Yahoo! Search - Faster. Easier. Bingo
>http://search.yahoo.com
>
>
>-------------------------------------------------------
>This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>Data Reports, E-commerce, Portals, and Forums are available now.
>Download today and enter to win an XBOX or Visual Studio .NET.
>http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>
|
|
From: David M. <ci...@ya...> - 2003-07-30 16:44:30
|
Ok, this is not a school assignment so please don't ask. I would like to produce a list of null terminated strings that I plan to use to test a hash function. Unfortunately I am a bit stumped as what would be the best way to create such a list. The algorithm is as follows: 1. Start with a string containing only a space. 2. Increment the first character in the string. 3. If the value of the first character is 127 (DEL) then set it to 32 (space) and increment the next character (repeat this step if that character is 127). 4. print out the string. 5. goto step 2. I know, Recursion is screaming at me to use it. Problem is, how? I am getting stuck in the wind-up section. (That and the fact that Visual C++ is giving me access violations) My other question is, does anyone else know another way? Eventually I hope to use this to create strings at least 100 chars long (possibly 1000). Could someone tell me if 100 levels using recursion cause a stack overflow? Thanks in Advance David Mcken __________________________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo http://search.yahoo.com |
|
From: <ten...@ne...> - 2003-07-30 16:37:37
|
In C code the variables have to be declared at the top of the function,
and in C++ it can happen anywhere. And Mr Darío Peralta has it with a
source compiled as C.
>
>
>> From: "Dario Peralta" <do...@ho...>
>> To: dev...@li...
>> Subject: [Dev-C++] Weird parse errors...
>> Date: Wed, 30 Jul 2003 00:05:10 -0400
>>
>>
>> I'm using Dev-C++ 4.01 on a Win98se machine...
>>
>> And I'm wondering why I always get a parse error when I try to create
>> a variable or an array after doing anything other than creating vars
>> and arrays... for example:
>>
>> int main(void)
>> {
>> int i, n, m;
>> /* insert whatever code: functions, meaningless loops, whatever */
>> int a;
>> return 0;
>> }
>>
>> will always give me an parse error on the line "int a;" is on... why
>> is that?
>>
>> thanks in advance...
>>
>> adios,
>> dario.
>> --------------------------------------------------------
>> It's time to toss the dice and hope that chance rolls in our favor.
>>
>> _________________________________________________________________
>> The new MSN 8: advanced junk mail protection and 2 months FREE*
>> http://join.msn.com/?page=features/junkmail
>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>> Data Reports, E-commerce, Portals, and Forums are available now.
>> Download today and enter to win an XBOX or Visual Studio .NET.
>> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
>>
>> _______________________________________________
>> Dev-cpp-users mailing list
>> Dev...@li...
>> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
> _________________________________________________________________
> Tired of 56k? Get a FREE BT Broadband connection
> http://www.msn.co.uk/specials/btbroadband
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: <ten...@ne...> - 2003-07-30 16:27:16
|
You've not allocated memory for buf.
You can do one of two options:
A) Declare an statically allocated array, such as char
buf[MAX_STRING_LENGTH_YOU_EXPECT];
or
B) Declarea a pointer to char as you do char *buf; and then allocated
eough memory to it buf = new char[MAX_STRING_LENGTH_YOU_EXPECT]
However, let's make some comments about this program (it's an example
from a book on using pointers?):
After you have assigned each cstr member of each str_ex array member,
all the members will have the same string. Why? Because you input an
string in buf and then you pass its memory location to the cstr member
(a pointer is a variable which value is a memory location). So all
str_ex array member will have their cstr member pointing to the same
memory location, so each time you change the string at buf you are
changing the string at that memory location and being that the same
memory location cstr are pointing to, all them haveit changed to the
same string.
If you want input different strings to each str_ex member array, then
you shall
A) Allocate memory directly to each struct member (str_ex[x].cstr = new
char [MAX_STRING_ETC]; and don't forget free the memory with delete[]
str_ex[x].cstr). This would means this couple of cycles:
for (int i = 0; i < 12; i++) /**of course, you do this cycle if you want
to input the strings for all array members one after the other, if not
you do the line below as many times you need with the valueas as needed**/
str_ex[i].cstr = new char[MAX_ETC];
and before the end of the program
for (int j = 0; j < 12; j++)
delete[] str_ex[j].cstr;
And for each x member array do cin >> str_ex[x].cstr;
B) The other way, which would make you achieve better memory usage
(depending on how many str_ex array size, value of MAX_ETC, and how
they'll be used after input is no more needed) would be using the buf
as intermediate, so you can do something like this.
buf = new char[MAX_ETC];
for (int i = 0; i < 12; i++){ /**Same comment as the previous option**/
cin >> buf;
str_ex[i].cstr = new char[function_you
_define_to_calculate_string_length_including_null_character(buf)];
strcpy(str_ex[i].cstr, buf);
}
So, now each str_ex array member has an cstr member pointing to its own
memory location, which is different for str_ex, and so you can change
them individually.
When you have finished inputting strings
delete[] buf;
then you work with str_ex array.
And it the end you make the same cycle as the previous option.
P.D. - As you gave no information about the expected and unexpected
behaviours, I cover the two options I can think about: that either you
get memory errors (and surely you'll get them) and you expect to change
array members individually and they're changed all them as one.
dawood wrote:
> Can anybody let me know, why the below code is not working correctly.
>
> #include <iostream.h>
> #include <stdlib.h>
>
> int main()
> {
> struct str_misc {
> char* cstr;
> };
> str_misc str_ex[12];
> char* buf;
>
> cin>>buf;
> str_ex[0].cstr= buf;
> cout<<str_ex[0].cstr<<"index=0"<<'\n';
>
> cin>>buf;
> str_ex[1].cstr= buf;
> cout<<str_ex[1].cstr<<"index=1"<<'\n';
>
> cout<<str_ex[0].cstr<<" repeat index=0"<<'\n';
> cout<<str_ex[1].cstr<<" repeat index=1"<<'\n';
>
> system("PAUSE");
> return 0;
> }
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Damien <g_...@ho...> - 2003-07-30 15:11:24
|
<html><div style='background-color:'><P align=left>Hello Dawood,</P>
<P align=left>Firstly, that 'char *buf' declaration: allocate some memory to it using <STRONG>new</STRONG> or <STRONG>malloc. </STRONG>Passing such a pointer to <STRONG>cin is dangerous</STRONG>( it crashed on my WinXP). The reason why it won't work how you would like it is because str_ex[0] and str_ex[1] point to the <STRONG>same</STRONG> memory address (at buf), so if buf is changed, the other pointers that point to buf will change as well(str_ex[0] and str_ex[2]). I suggest giving the cstr member of each structure its own memory space, and copy the buf into each as seen below.</P>
<P align=left>#include <iostream.h> <BR>#include <stdlib.h> <BR>#include <string.h><BR>int main() <BR>{ <BR> struct str_misc { <BR> char* cstr; <BR> }; <BR> str_misc str_ex[2]; <BR> char* buf = new char[50];</P>
<P align=left> cin>>buf; <BR> str_ex[0].cstr = new char[50];<BR> <BR> strncpy(str_ex[0].cstr,buf,49);<BR> <BR> cout<<str_ex[0].cstr<<"index=0"<<'\n'; </P>
<P align=left> cin>>buf; <BR> <BR> str_ex[1].cstr = new char[50]; <BR> <BR> strncpy(str_ex[1].cstr,buf,49);<BR> <BR> cout<<str_ex[1].cstr<<"index=1"<<'\n'; </P>
<P align=left> cout<<str_ex[0].cstr<<" repeat index=0"<<'\n'; <BR> cout<<str_ex[1].cstr<<" repeat index=1"<<'\n'; <BR> delete str_ex[0].cstr;<BR> delete str_ex[1].cstr;<BR> system("PAUSE");<BR> return 0; <BR>} <BR><BR></P>
<DIV></DIV>----Original Message Follows----
<DIV></DIV>From: dawood <DA...@KU...>
<DIV></DIV>To: Dev C++ <DEV...@LI...>
<DIV></DIV>Subject: [Dev-C++] getting unexpected results
<DIV></DIV>Date: Tue, 22 Jul 2003 19:50:51 +0800
<DIV></DIV>
<DIV></DIV>Can anybody let me know, why the below code is not working correctly.
<DIV></DIV>
<DIV></DIV>#include <IOSTREAM.H>
<DIV></DIV>#include <STDLIB.H>
<DIV></DIV>
<DIV></DIV>int main()
<DIV></DIV>{
<DIV></DIV>struct str_misc {
<DIV></DIV>char* cstr;
<DIV></DIV>};
<DIV></DIV>str_misc str_ex[12];
<DIV></DIV>char* buf;
<DIV></DIV>
<DIV></DIV>cin>>buf;
<DIV></DIV>str_ex[0].cstr= buf;
<DIV></DIV>cout<<STR_EX[0].CSTR<<"INDEX=0"<<'\N'; DIV <>
<DIV></DIV>cin>>buf;
<DIV></DIV>str_ex[1].cstr= buf;
<DIV></DIV>cout<<STR_EX[1].CSTR<<"INDEX=1"<<'\N'; DIV <>
<DIV></DIV>cout<<STR_EX[0].CSTR<<" DIV < index="0"<<'\n';" repeat> cout<<STR_EX[1].CSTR<<" DIV < index="1"<<'\n';" repeat>
<DIV></DIV>system("PAUSE");
<DIV></DIV>return 0;
<DIV></DIV>}
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>-------------------------------------------------------
<DIV></DIV>This SF.Net email sponsored by: Free pre-built ASP.NET sites including
<DIV></DIV>Data Reports, E-commerce, Portals, and Forums are available now.
<DIV></DIV>Download today and enter to win an XBOX or Visual Studio .NET.
<DIV></DIV>http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
<DIV></DIV>_______________________________________________
<DIV></DIV>Dev-cpp-users mailing list
<DIV></DIV>Dev...@li...
<DIV></DIV>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
<DIV></DIV>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
<DIV></DIV></div><br clear=all><hr>Add photos to your messages with <a href="http://g.msn.com/8HMCENUS/2749??PS=">MSN 8. </a> Get 2 months FREE*.</html>
|
|
From: TJC <web...@tj...> - 2003-07-30 12:15:49
|
Hi, An author of a few commerically printed books called 'Bruce Eckel' posts complete online forms of his books (legally) for free download/use. Although the books are focused on C++, a few are mostly just teaching differences between C and C++. His website for the books is http://mindview.net/Books/books.html. All his books are available on Amazon in print. Hope this helps TJC ----- Original Message ----- From: "Michael D. Smith" <for...@hi...> To: <dev...@li...> Sent: Wednesday, July 30, 2003 7:58 AM Subject: Re: [Dev-C++] newbie > > Library is the first place to look. No, they don't really let you keep it > long enough to learn a programming language (unless you're awful fast) but > if you see one you like, you can always buy it later and knowing the ones > you don't like is a help as well. Sometimes they sell used books for as > little as a quarter. I've built my personal library up quite a bit that > way. Just this week I bought four for a buck and half ( one thousand page > $60 to $80 books). One still had the shrink wrap on it. > > The guy at my library ordered and just "gave" me a brand new PERL > programming book. I say, "gave," I've had it for years but he did say if he > ever needs to explain where it is he knows where it is, and I would give it > back if I had to, but after all this time, I don't think that's going to > happen. Admittedly, it's unlikely everyone will find quite such an > accommodating librarian but build a relationship with them and you WILL > benefit. > > Call a local college/university that teaches the course you're interested > in, and ask what book they use for the first beginning level class. They > usually use good "long explaining" beginning level books, and if you ever > do decide to take the course, any reading you've done in the book will put > you up on your future classmates. Also, You're just not ready for the 1000 > page complete works type book yet. You will eventually have to buy one > though. You'll probably never read that one but they are useful for looking > up what you need as you need it -- After you learn how. > > Be sure to check prices at Amazon.com, and the College bookstore. You'll > probably find them $10 to $20 cheaper online. I did. > > Of course a teacher is best and if you plan to be good, you will eventually > have to take some classes. There is just no substitute for back and forth > exchange of talking to a person when you're lost and confused. > > This approach helped me save quite a bit of money and make A's when I did > take the courses. It never hurts if you're going to do something to look > good doing it:) > > As for is Dev-C++ right for you, my opinion (everybody has one) is if you > are command line oriented, probably not. If you're Windows oriented, yes. > I've heard some say it's to hard for beginners but I opened it right up and > started within minutes -- of course I have considerable windows experience > (I bought '95 in '95). If Windows still baffles you sometimes, you may have > some trouble. About that I really couldn't say, but I fear you might. > > In any case, good luck:) > > ms > > > > > > At 07:48 AM 7/29/03, you wrote: > > >I'm looking to teach myself C. I have basic to intermediate experience in > >HTML, PHP, CSS, ActionScript and JavaScript. Is Dev-C++ the right tool > >for me to start with? Also, can anyone recommend a good beginner's book on C. > >Thanks > > > > > > > > > >---------- > >The new <http://g.msn.com/8HMIENUS/2737??PS=>MSN 8: smart spam protection > >and 2 months FREE* ------------------------------------------------------- > >This SF.Net email sponsored by: Free pre-built ASP.NET sites including > >Data Reports, E-commerce, Portals, and Forums are available now. Download > >today and enter to win an XBOX or Visual Studio .NET. > >http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > > _______________________________________________ Dev-cpp-users mailing > >list Dev...@li... TO UNSUBSCRIBE: > >http://www23.brinkster.com/noicys/devcpp/ub.htm > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > |
|
From: Daniel G. <sp...@ho...> - 2003-07-30 09:20:41
|
what are the error messages?
Is struct str_misc declared in stdlib ?
>From: dawood <da...@ku...>
>To: Dev C++ <dev...@li...>
>Subject: [Dev-C++] getting unexpected results
>Date: Tue, 22 Jul 2003 19:50:51 +0800
>
>Can anybody let me know, why the below code is not working correctly.
>
>#include <iostream.h>
>#include <stdlib.h>
>
>int main()
>{
> struct str_misc {
> char* cstr;
> };
> str_misc str_ex[12];
> char* buf;
>
> cin>>buf;
> str_ex[0].cstr= buf;
> cout<<str_ex[0].cstr<<"index=0"<<'\n';
>
> cin>>buf;
> str_ex[1].cstr= buf;
> cout<<str_ex[1].cstr<<"index=1"<<'\n';
>
> cout<<str_ex[0].cstr<<" repeat index=0"<<'\n';
> cout<<str_ex[1].cstr<<" repeat index=1"<<'\n';
>
> system("PAUSE");
> return 0;
>}
>
>
>
>-------------------------------------------------------
>This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>Data Reports, E-commerce, Portals, and Forums are available now.
>Download today and enter to win an XBOX or Visual Studio .NET.
>http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Use MSN Messenger to send music and pics to your friends
http://www.msn.co.uk/messenger
|
|
From: Daniel G. <sp...@ho...> - 2003-07-30 08:14:31
|
In C code don't the variables have to be declared at the top of the
function, and in C++ it can happen anywhere?
>From: "Dario Peralta" <do...@ho...>
>To: dev...@li...
>Subject: [Dev-C++] Weird parse errors...
>Date: Wed, 30 Jul 2003 00:05:10 -0400
>
>
>I'm using Dev-C++ 4.01 on a Win98se machine...
>
>And I'm wondering why I always get a parse error when I try to create a
>variable or an array after doing anything other than creating vars and
>arrays... for example:
>
>int main(void)
>{
>int i, n, m;
>/* insert whatever code: functions, meaningless loops, whatever */
>int a;
>return 0;
>}
>
>will always give me an parse error on the line "int a;" is on... why is
>that?
>
>thanks in advance...
>
>adios,
>dario.
>--------------------------------------------------------
>It's time to toss the dice and hope that chance rolls in our favor.
>
>_________________________________________________________________
>The new MSN 8: advanced junk mail protection and 2 months FREE*
>http://join.msn.com/?page=features/junkmail
>
>
>
>-------------------------------------------------------
>This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>Data Reports, E-commerce, Portals, and Forums are available now.
>Download today and enter to win an XBOX or Visual Studio .NET.
>http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Tired of 56k? Get a FREE BT Broadband connection
http://www.msn.co.uk/specials/btbroadband
|
|
From: Daniel G. <sp...@ho...> - 2003-07-30 08:12:58
|
I know with iostream it is cout << &var;
but not sure if ostream is different. Could maybe has
ostream OsObj;
OsObj << &var;
But I've not tried it.
>From: "Esteban Valverde" <est...@ho...>
>To: "dev-cpp" <dev...@li...>
>Subject: [Dev-C++] Manipulator
>Date: Tue, 29 Jul 2003 15:37:39 -0300
>
>Hi, which is the ostream manipulator to printf the direction of a varible ?
>In C it can be obtained by the next sentence...
>
>int var;
>...
>printf("%p", &var);
>
>bye, Esteban
>
>
>
>-------------------------------------------------------
>This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>Data Reports, E-commerce, Portals, and Forums are available now.
>Download today and enter to win an XBOX or Visual Studio .NET.
>http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
On the move? Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile
|
|
From: Ioannis V. <iv...@em...> - 2003-07-30 08:06:57
|
> -----Original Message----- > From: Marc Heiligers [mailto:ma...@e-...]=20 > Sent: Wednesday, July 30, 2003 8:07 AM > To: 'Per Westermark'; 'Abhijit Shylanath' > Cc: 'Ioannis Vranos'; dev...@li... > Subject: RE: [Dev-C++] Overloading ()() >=20 >=20 > Hi All, >=20 > As I said, the example was contrived and not useful. Casting=20 > to different > int types is not what I had in mind, but it served to get the question > across without declaring 10 different classes and overloading the type > operator. Anyway thanks for the input, everybody. Ioannis' answer was > correct, although it was so brief I had to read it ten times before I > understood what he meant. I have been very busy these last days that essentially I haven't read = any emails on this thread since my answer. I saw that type casts were = mentioned in the mean time. What casts?! These "type conversions" are not to be used regularily, but only in = specific cases when doing otherwise introduces significant disadvantages. Use encapsulation and abstraction for the usual stuff (access via member functions and stuff). You will find that in most cases that the implicit type conversions you = need will occur via the implicit calls of constructors and the creation of temporaries (which sometimes we wish to avoid thus the use of the = keyword explicit, but that's another story). Ioannis Vranos =20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
|
From: Michael D. S. <for...@hi...> - 2003-07-30 06:58:53
|
Library is the first place to look. No, they don't really let you keep it long enough to learn a programming language (unless you're awful fast) but if you see one you like, you can always buy it later and knowing the ones you don't like is a help as well. Sometimes they sell used books for as little as a quarter. I've built my personal library up quite a bit that way. Just this week I bought four for a buck and half ( one thousand page $60 to $80 books). One still had the shrink wrap on it. The guy at my library ordered and just "gave" me a brand new PERL programming book. I say, "gave," I've had it for years but he did say if he ever needs to explain where it is he knows where it is, and I would give it back if I had to, but after all this time, I don't think that's going to happen. Admittedly, it's unlikely everyone will find quite such an accommodating librarian but build a relationship with them and you WILL benefit. Call a local college/university that teaches the course you're interested in, and ask what book they use for the first beginning level class. They usually use good "long explaining" beginning level books, and if you ever do decide to take the course, any reading you've done in the book will put you up on your future classmates. Also, You're just not ready for the 1000 page complete works type book yet. You will eventually have to buy one though. You'll probably never read that one but they are useful for looking up what you need as you need it -- After you learn how. Be sure to check prices at Amazon.com, and the College bookstore. You'll probably find them $10 to $20 cheaper online. I did. Of course a teacher is best and if you plan to be good, you will eventually have to take some classes. There is just no substitute for back and forth exchange of talking to a person when you're lost and confused. This approach helped me save quite a bit of money and make A's when I did take the courses. It never hurts if you're going to do something to look good doing it:) As for is Dev-C++ right for you, my opinion (everybody has one) is if you are command line oriented, probably not. If you're Windows oriented, yes. I've heard some say it's to hard for beginners but I opened it right up and started within minutes -- of course I have considerable windows experience (I bought '95 in '95). If Windows still baffles you sometimes, you may have some trouble. About that I really couldn't say, but I fear you might. In any case, good luck:) ms At 07:48 AM 7/29/03, you wrote: >I'm looking to teach myself C. I have basic to intermediate experience in >HTML, PHP, CSS, ActionScript and JavaScript. Is Dev-C++ the right tool >for me to start with? Also, can anyone recommend a good beginner's book on C. >Thanks > > > > >---------- >The new <http://g.msn.com/8HMIENUS/2737??PS=>MSN 8: smart spam protection >and 2 months FREE* ------------------------------------------------------- >This SF.Net email sponsored by: Free pre-built ASP.NET sites including >Data Reports, E-commerce, Portals, and Forums are available now. Download >today and enter to win an XBOX or Visual Studio .NET. >http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ Dev-cpp-users mailing >list Dev...@li... TO UNSUBSCRIBE: >http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Luigi S. <gi...@li...> - 2003-07-30 05:44:36
|
> Andrew Fling wrote: > > I'm looking to teach myself C. I have basic to intermediate experience in > HTML, PHP, CSS, ActionScript and JavaScript. Is Dev-C++ the right tool for > me to start with? Also, can anyone recommend a good beginner's book on C. > Thanks > The following address was given sometime ago on this list: www.observatorio.unal.edu.co/virtual/books once there, look for "The C Programming Language by K&R". Remarks: - I understand that you like HTML, but please try to avoid it in your email :-) - I don't know if the books are available on a legal basis - I don't know if the book of K&R is the famous (C-bible) 2nd edition Regards -- >> gisan >> |
|
From: Marc H. <ma...@e-...> - 2003-07-30 05:07:36
|
Hi All,
As I said, the example was contrived and not useful. Casting to different
int types is not what I had in mind, but it served to get the question
across without declaring 10 different classes and overloading the type
operator. Anyway thanks for the input, everybody. Ioannis' answer was
correct, although it was so brief I had to read it ten times before I
understood what he meant.
__________________________________
Marc Heiligers
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Per
Westermark
Sent: 29 July 2003 20:26
To: Abhijit Shylanath
Cc: Ioannis Vranos; dev...@li...
Subject: RE: [Dev-C++] Overloading ()()
It is valid in the sense that a class shouldn't implement a lot of type
conversions just because it can. It should still be up to the user to
perorm any typecasts from int to xx.
Normally, operator type() is used to perform type-conversions that may not
be performed by a single type-cast - converting an integer to a string, or
an object that encapsulates several sub-objects, for example:
class CSurfInfo;
class CVec3;
class CTransform;
class C3DObject {
public:
operator CSurfInfo&();
operator CTransform&();
operator CVec3&();
};
C3DObject *pObj;
...
setSurface((CSurfInfo*)*pObj);
/Per W
On Tue, 29 Jul 2003, Abhijit Shylanath wrote:
> > operator unsigned char()
> >
> > The return value is the type.
>
> Okay, so my post (argument list should be different, not return type)
isn't
> valid, I guess. Sorry.
>
> --
> Abhijit Shylanath
> Homepage: http://mudeth.tripod.com/
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
>
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: dawood <da...@ku...> - 2003-07-30 04:06:53
|
Can anybody let me know, why the below code is not working correctly.
#include <iostream.h>
#include <stdlib.h>
int main()
{
struct str_misc {
char* cstr;
};
str_misc str_ex[12];
char* buf;
cin>>buf;
str_ex[0].cstr= buf;
cout<<str_ex[0].cstr<<"index=0"<<'\n';
cin>>buf;
str_ex[1].cstr= buf;
cout<<str_ex[1].cstr<<"index=1"<<'\n';
cout<<str_ex[0].cstr<<" repeat index=0"<<'\n';
cout<<str_ex[1].cstr<<" repeat index=1"<<'\n';
system("PAUSE");
return 0;
}
|
|
From: Dario P. <do...@ho...> - 2003-07-30 04:05:16
|
I'm using Dev-C++ 4.01 on a Win98se machine...
And I'm wondering why I always get a parse error when I try to create a
variable or an array after doing anything other than creating vars and
arrays... for example:
int main(void)
{
int i, n, m;
/* insert whatever code: functions, meaningless loops, whatever */
int a;
return 0;
}
will always give me an parse error on the line "int a;" is on... why is
that?
thanks in advance...
adios,
dario.
--------------------------------------------------------
It's time to toss the dice and hope that chance rolls in our favor.
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
|
|
From: Smurf, P. <smu...@xs...> - 2003-07-30 02:43:13
|
Its possibly true but I don't have the money for VS. I'm doing this as an hobby. However I have used VS6 and don't miss it. -----Original Message----- From: Scott Simontis SIMONTIS [mailto:age...@co...] Sent: dinsdag 29 juli 2003 21:29 To: Smurf, Papa Subject: Re: RE: [Dev-C++] newbie Visual C++ is the way to go. Some consider it confusing, but without reading anything about it, I hopped on to Visual Studio C++ 6.0 and within 20 minutes had customized the editor to my likings and was writing C+ applications. And there really is no pure C++ or C. It must have an operating system to run off of. You are still working with MS_DOS, so Microsoft compilers are the way to go. The latest version is .NET. It is like Visual Studio 7.1. I am in the middle of a computer upgrade, but afterwards, I plan to purchase Visual Studio .NET. Or at least the Visual BASIC and C++ portions of it. ~~Scott Simontis~~ Programmer ----- Original Message ----- From: "Smurf, Papa" <smu...@xs...> Date: Tuesday, July 29, 2003 3:14 pm Subject: RE: [Dev-C++] newbie > Hi, > > I'm a beginner too and I think DevCPP is perfect for beginners. > For two > reasons its free and not bloated. The bloat of Visual Studio may > confuse you > and Visual Studio is more directed towards Win32 development then pure > c/c++. > > As for books. I am using my self Teach your self C in 24 hours. > Which is > good but a bit dry. I mean its all info and examples and no > fillers or > something like that. Some people may prefer books like this. I > manage with > it. Its starts very easy and builds up slowly. However if money is > a problem > you can find a lot of good free C/c++ books on the net. Just > google for it. > (hint: mindview). > -----Original Message----- > From: dev...@li... > [dev...@li...]On Behalf Of Andrew Fling > Sent: dinsdag 29 juli 2003 14:49 > To: dev...@li... > Subject: [Dev-C++] newbie > > > > I'm looking to teach myself C. I have basic to intermediate > experience in > HTML, PHP, CSS, ActionScript and JavaScript. Is Dev-C++ the right > tool for > me to start with? Also, can anyone recommend a good beginner's > book on C. > Thanks > > > > > > ------------------------------------------------------------------- > --------- > -- > The new MSN 8: smart spam protection and 2 months > FREE* ------------------------------------------------------- This > SF.Netemail sponsored by: Free pre-built ASP.NET sites including > Data Reports, > E-commerce, Portals, and Forums are available now. Download today > and enter > to win an XBOX or Visual Studio .NET. > http://aspnet.click- > url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01________________ _______________________________ Dev-cpp-users mailing list > Dev...@li... TO UNSUBSCRIBE: > http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |