LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-04-2019, 10:13 PM   #1
Myphre
LQ Newbie
 
Registered: Oct 2018
Posts: 21

Rep: Reputation: Disabled
Question Doubt - Memory, Linux, Output of a C code (?)


Sorry if it is not the best place to put that topic, but I'm with a doubt about some output of a code that I made in C and run in different distros. You can find the code here: https://hastebin.com/oyovisolef.cpp
If you run the code, you will see that in the third attribution something (a static memory???) went wrong: what i receive? Why that number isnt change after a reboot? Why he cant be modificated? What hell is that? haha
When I was learning C i had been teached that when i try to atribute something to a memory that memory receives it and because of that pointers and overflows are too danger if used wrong. So.. what is that memory?
I know, the code produced a overflow, the function could be void, i started the code thinking to use list instead of arrays... but i'm new on computer science and Linux and cant imagine what is happening in the domain of memory - in the domain of C i understood the problem, i think.


Sorry for my english, i'm from brazil.
If needed, i can translate the code
 
Old 06-04-2019, 10:49 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
Please review the Site FAQ for guidance in posting your questions and general forum usage. Especially, read the link in that page, How To Ask Questions The Smart Way. The more effort you put into understanding your problem and framing your questions, the better others can help!

You have not provided much information useful for others to understand the problem. Requiring that others go to a third site and download, compile and run your code simply to understand the question is asking a lot of people who would volunteer their time to help.

The best way to get help is to reduce the problem to a minimal, shortest code example which demonstrates the problem, and which others can view in a single page along with a well formed description and question. This also helps you to understand the problem better and often leads to a solution before you are finished asking the question!

Please try to restate your question with a minimal code example pasted in page, describe what you expect of it and how that differs from what it is doing, along with any error messages, and you will receive more useful replies!

Good luck!
 
2 members found this post helpful.
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Doubt in the output when modules dependency builded using busybox script depmod.pl ayyasprings Linux - Embedded & Single-board computer 2 09-04-2014 02:58 AM
Questions about consumption of the swap memory. A great doubt !! pauloedusp Linux - Server 1 04-27-2012 09:04 AM
Memory Size doubt karlochacon Linux - Newbie 7 03-19-2010 08:46 AM
Doubt with shared memory (IPC). webquinty Linux - Newbie 0 11-05-2008 10:51 AM
Doubt about how a linker builds a memory image funkymunky Programming 4 02-18-2005 11:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration