Fedora Linux Support Community & Resources Center
  #1  
Old 24th January 2012, 05:32 PM
johnnytda Offline
Registered User
 
Join Date: Sep 2010
Location: Romania::Transilvania
Posts: 45
linuxopera
How much memory is allocated?

Hi, when I try to compile this code the following error occurs:
Line 3: error: stray '\ 302' in program
compilation terminated due to-Wfatal-errors.

This code is:
class Empty
{
int null;
public:
Empty(){}
~Empty(){}
};

class EmptyToo : public Empty
{
public:
EmptyToo(){}
virtual ~EmptyToo(){}
};

class EmptyThree : public EmptyToo
{
public:
EmptyThree(){}
~EmptyThree(){}
};

int main()
{
std::cout << sizeof(EmptyThree);

return 0;
}

Please help me correct this error and tell me how much memory is allocated? Thank you.

---------- Post added at 05:32 PM ---------- Previous post was at 03:53 PM ----------

No one knows even, o God,
Reply With Quote
  #2  
Old 25th January 2012, 09:40 AM
bepaald Offline
Registered User
 
Join Date: Nov 2004
Posts: 124
linuxfirefox
Re: How much memory is allocated?

Hi!

I think you are not saving your code as plain ASCII text. See: http://forums.fedoraforum.org/showthread.php?t=272296.

When I copy this text, paste it in a text file, save and compile it works fine (after including <iostream>). The output is '8'.

bepaald
__________________
Running F20 x86_64 with KDE
Intel Core i7-4771 @ 3.5GHz
8G RAM

Last edited by bepaald; 25th January 2012 at 09:42 AM.
Reply With Quote
  #3  
Old 26th January 2012, 09:27 PM
johnnytda Offline
Registered User
 
Join Date: Sep 2010
Location: Romania::Transilvania
Posts: 45
linuxopera
Re: How much memory is allocated?

Hi!
I used an online compiler, but I not included at the beginning # <iostream>

I used this online compiler http://codepad.org/
Reply With Quote
  #4  
Old 26th January 2012, 09:32 PM
marko Offline
Registered User
 
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 6,067
linuxfirefox
Re: How much memory is allocated?

And if you compile on a 64bit fedora and forget to use the -m32 flag the output is "16"
Reply With Quote
  #5  
Old 26th January 2012, 09:43 PM
diamond_ramsey Offline
Registered User
 
Join Date: Aug 2009
Posts: 790
macossafari
Re: How much memory is allocated?

Quote:
Originally Posted by johnnytda View Post
Hi!
I used an online compiler, but I not included at the beginning # <iostream>

I used this online compiler http://codepad.org/
That is a cool online compiler!!!
__________________
2 dual cores, 11 GB RAM, F18 Spherical Cow - 3.11.10-100.fc18.x86_64 / i686
2 dual cores, 11 GB RAM, F19 Schrödinger's Cat - 3.14.22-100.fc19.x86_64 / i686
2 dual cores, 11 GB RAM, F20 Heisenbug - 3.16.6-200.fc20.x86_64 / i686
2 dual cores, 11 GB RAM, F21 - 3.17.1-302.fc21.x86_64 / i686
80 x86_64 computing cores, 144 GB RAM & 8 SATA Seagate 7200.12 500 GB harddisks
Reply With Quote
Reply

Tags
allocated, memory

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
IO APIC resources couldnt be allocated polhen Installation, Upgrades and Live Media 8 30th October 2009 01:15 PM
Error message: "I/O APIC resources could not be allocated" ahartman Installation, Upgrades and Live Media 0 25th June 2009 11:48 AM
Wants to change allocated memory SunilReddy Installation, Upgrades and Live Media 3 31st December 2007 06:36 PM
Char Device Driver - Buffer Length - Allocated/ Used sciconf Using Fedora 0 14th August 2006 10:15 PM
Allocated filehandles always grow till max and then it crashes haydenm315 Installation, Upgrades and Live Media 3 29th April 2005 02:55 PM


Current GMT-time: 18:13 (Thursday, 30-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Mmabatho - Santos Dumont - Deception Bay Photos on Instagram