Programming :: Max Int Size Now Available?
May 1, 2011
I am doing prime number research and I need to know what the max int size is? Does gcc support any other number declarations that would be better than just plain old int (this is in C BTW) that allow for integer handling?
View 4 Replies
ADVERTISEMENT
Jul 18, 2011
I am adding a user header(restart.h), which has a bunch of prototypes and a library(restart.c), which includes functions for those protoypes. I know that headers go in /usr/include. However, where do I put the restart.c file? Under /usr/lib? I took a look at /usr/lib and it just doesn't feel like this is the appropriate place. How do I check gcc to see the PATH it checks for headers and libraries?
Also in variable types, what's the different between and int, size and ssize?
View 6 Replies
View Related
Dec 28, 2010
I want to read a file in C, but i dont know the size of the file. Is there any way to find the size of the file in C...?
View 2 Replies
View Related
Mar 25, 2010
script that will check if my log file is a certain size? EX: I want to limit the size of my rsync log to say 5MB, if that's true I would move it and create a new one.
View 4 Replies
View Related
Apr 3, 2010
Using bash, is it possible to get the average file size of each file in a directory of ~2000 files?
View 7 Replies
View Related
May 1, 2011
Why is it in Linux that there is a stack size set by default? And why is it so small? (My system is set to 8192 kbytes.) And why is there a default limit on the stack size when the max memory and virtual memory size are, by default, unlimited? (Aren't they both fed from the same place ultimately?)
Reason I ask: I want to use recursive functions in my programming a lot more. Problem is, if the language (or implementation) doesn't happen to support tail-call recursion, then I can be pretty well certain that the first huge problem that gets thrown at my function is going to kill my program because the stack size limit is going to be quickly reached. Obviously, I can change the stack size limit for my own computers, but it doesn't feel so great knowing that most of the people who copy and execute my code will have probably have overlooked this. Anyway, does anyone know: is this small default stack size limit just one of those historical artifacts, or is there some technical reason for it?
View 5 Replies
View Related
Mar 10, 2009
i am trying to find the size of an array, not by using the array as a parameter to "sizeof", but by using a pointer -pointing to the array- as a parameter. How do i do this?I use a 32-bit PC.Here's:
Code:
#include <string>
#include <iostream>
[code]...
View 2 Replies
View Related
Oct 16, 2010
How do you go about getting the raw size of a block device under Linux from within a C program? And I mean the raw size of the block device itself, not a file system that may or may not be installed on it. And I'd like to be able to get the raw size of any block device, from hard drives (e.g., /dev/sda) to LVM partitions (/dev/mapper/vg0-home) to loop devices to anything else that is a Linux block device.
View 3 Replies
View Related
Jun 24, 2010
I have the following which works but think there must be a easier one-liner way of doing this which involves not writing to a file but have failed to find something that works This is what I have:
Code:
du -m $i > filesize.txt
FILESIZE=$`cat "filesize.txt" | cut -f1
rm filesize.txt
I then use the FILESIZE to compare to a number.
View 3 Replies
View Related
Jan 23, 2011
I seem to only be able to set my stack size on my linux server to 15000. If I increase it to 20000 I get a Segmentation Fault. how I can get the linux OS to increase the stack size? Code: threadRet |= pthread_attr_setstacksize( &m_ThreadAttributes, 15000 );
View 8 Replies
View Related
May 17, 2011
The last time I got involved with printers and fonts, printers had tractors and ribbons and the only codes in use were ascii and ebcdic. So even if I could remember it would be out of date. I've written a C program that writes a text file. I want to print it. I run it through expand and send it to lp, but it comes out in an undesirable primitive font.
Once upon a time, one sent a string of commands to the printer telling it what font to use and what size, etc. I dont think this is done anymore, and if it is I dont remember how to do it. I assume programs embed in their output instructions in some common format which tell this stuff to the printer - in my case a HP1020. I've been looking on the search engines but I haven't found the magic words to find what I want. how to get my output formatted. If it involves some escape sequences in the file, maybe a pointer to a description of which does what?
View 2 Replies
View Related
Jun 13, 2010
I am working on a C++ application, using the latest Slax as distro and CodeBlocks 8.02 as IDE.
I have a problem that is really biting me hard... And i'm sorry if my questions will sound trivial: i'm still a C++ noob...
Basically,looking with KSysGuard i can notice a constant increment of the VmRss parameter,i.e. the resident set size of my program.
While stepping with the debugger i noticed that the VmRss parameter increases by 4 (KB?) when i push_back into some STL vectors (i have this problem in various parts of the code).
While i analyze the problem with KSysGuard i'm also looking at the /proc/statm file of my process. When KSysGuard shows a VmRss increment by 4, i can actually see an increment (by 1) in the 2nd parameter of that file (which is the resident set size) but not in the 1st parameter (which is the total program size).
What surprises me most is that the VmRss is reported in KB and i really am not pushing 4 KB inside the vector all at once...
So i ask:
1)Is this a memory leak?
2)Why the total program size doesn't increase?
3)To me, it looks like VmRss increases "cumulatively" only after several insertions in the various vectors.
View 3 Replies
View Related
Feb 19, 2010
I have created a file with a pre-defined size as follows:
Code:
#define FILEPATH "testfile"
#define FILESIZE 16
[code]...
View 5 Replies
View Related
Mar 15, 2011
Is there any maximum limit to the heap memory allocation?My program is in PERL and i am using a solaris system. when i did "pmap pid" (pid = my process id) it is showing a number of heap memory allocated and all of them with GB sizes. This single process is eating up most of the physical memory.Is it normal and is there any way to get the heap memory size down
View 3 Replies
View Related
Mar 29, 2010
I am trying to increase the font size in the evolution xml file to make the sub-menu easier to read (the menu with new, send/receive, reply, reply to all, forward) I found where the xml file is located but i can not seem to adjust the font. is there a different syntax for xml for changing font than html/css?
View 2 Replies
View Related
Oct 27, 2010
If I have an array which its size is based on the user input, from some material, I need to use malloc function to allocate memory for that array what is known dynamic array. Don't forget to free it.hat's fine, however, I like to try things out even I know the program will crash.I have written some test program on my Mac using C language like this:int width = 0;//get user input, and assign the input value to width, for example, 3char * array_var[width];and width is an int, its value will be assigned by the user input. The point is, this program work as expected, for example, in command line, I input 3, then array_var length is 3, its size is 3 * sizeof(char *).
View 1 Replies
View Related
Jan 20, 2009
I'm trying to write a script that will calculate a directory size and if the size is greater than 4GB, it will send out an email. But I am getting the "integer operation expected" error when it tries to calculate the current disk size. Here's my script.
Code:
TO="user@email.com"
SUBJ="Ready for DVD burning on `hostname`"
MAIL="/bin/mail"
[code]....
View 1 Replies
View Related
Feb 9, 2010
How to restrict the maximum size of an array variable in perl such that Ishould not be able to have array elements beyond the maximum size?
View 7 Replies
View Related
Jul 14, 2010
I am writing a program in C to create a GUI application using GTK 2. My actual program is quite large, so I am using a modified version of the sample program from GNOME library for trial. I wish to increase the font size, and I have using PangoFontDescription. I have made that section of the code bold and italic below for quick reference to the code that affects fonts. But it does not make any difference. I am compiling the C file using gcc. The code is as follows(hello.c):
#include <gtk/gtk.h>
#include <glib.h>
#include <gdk/gdk.h>
[code]....
View 5 Replies
View Related
Apr 24, 2011
So I've been writing a code and I have been adding functions to make life easy, but all of a sudden when i added the last function I got this error *** glibc detected *** /home/ahzeeper/Desktop/C-code/check6: free(): invalid next size (fast): 0x0804c048 ***followed by a huge backtraceNow here is my code
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
[code]...
View 3 Replies
View Related
Jul 12, 2011
Here [URL].. it says that you need to provide a block size to open an archive. What does that mean, and what would be a good number to use?
View 1 Replies
View Related
Apr 15, 2010
I am curious if there is a way to describe and use variable sized multi-dimensional arrays in C using pointers. I mean, for 1-dimensional array e.g. I can use the following piece of code:
...
int i , N;
int *array;
scanf("%d", &N);
array = (int*) malloc(N*sizeof(int));
for (i=0; i<N; ++i) array[i] = i; // Assigning values to the array
for (i=0; i<N; ++i) printf("%d ", array[i]); // Printing the assigned values
free (array);
...
But what about the two dimensional array[N][M] ? I guess I have to use a double pointer e.g: int **array. But how exactly? Note that I use C90 and not C99.
View 2 Replies
View Related
Sep 24, 2010
Can anyone tell me what's going on?(this is the latest version of WINDOZE MySQL (sorry!) downloaded from the web.)
View 2 Replies
View Related
Feb 17, 2010
I am trying to scroll text from a text file across a wx.panel. This is the code so far:
Code:
def scrolling(self, text, rate):
def scroll(): charList = []
dc = wx.ClientDC(self.panel_1)
open_text = open(text, "rb")
my_text = open_text.read()
charList.append(my_text) open_text.close()
x,y = self.panel_1.GetClientSizeTuple()
while 1: for z in charList: for r in range(2000):
dc.DrawText(z,x-r,0) time.sleep(rate) dc.Clear()
net3 = threading.Thread(target=scroll)
net3.setDaemon(1) net3.start()
It scrolls but I am guessing where the range is (2000). I need to be able to determine the total number of pixels that the text in the file is. Is there a python way to determine this?
View 1 Replies
View Related
Jan 21, 2009
I have a file that's supposed to be growing in size 24/7. I want to check every 10 minutes via cron that it's actually growing. If not, send an email. Does anyone know how to write a script to do that?
View 3 Replies
View Related
Sep 12, 2009
Need to handle SIGSEGV error when pbuf size is less than size. inside lib.:
for (i = 0; i < size; i++)
pbuf[i] = i;
View 2 Replies
View Related
Jun 22, 2011
Using getrlimit I am setting the core file size to be RLIM_INFINITY. But still the core file is not being generated,although in /var/log/messages it says a core is being generated
View 3 Replies
View Related
Jul 1, 2010
I use ioctl to get the console window size (the SSH window). I use the following code:
struct winsize ws;
int returnValue = ioctl(pCommandStructure->terminal, TIOCGWINSZ, &ws);
int numberOfColumnsOfTerminalWindow = ws.ws_col;
When I debug on linux pc, it gives me the correct window width. But after I try it on router (this is my enventual place where my code shall run), ioctl always give me 0 width, that is, numberOfColumnsOfTerminalWindow == 0. but the returnValue is 0 which means that the function call succeeds.
View 2 Replies
View Related
May 7, 2011
The check on the size of a file I perform in a tcsh script does not work. The size of my file is the following :
ls -l File.gpg
-rw-r--r-- 1 xuo users 3354637392 2011-05-07 15:31 File.gpg
The script is the following :
#!/bin/tcsh -f
set listOfEncryptFiles = `ls *.gpg`
foreach file ($listOfEncryptFiles)
set fileSize = `stat -c %s $file`
echo $fileSize
[Code]....
View 6 Replies
View Related
Jun 30, 2011
I'm struggling with a C# program to read binary records from a database. The records were created with Borland Delphi. Error: You cannot use fixed size buffers contained in unfixed expressions. Try using the fixed statement.
View 1 Replies
View Related