I am trying to read in a string from the command line, copy it to another and then print it out character by character in the following code. I get a segfault when I use 'exp[i]'. Any ideas why, and...
Type: Posts; User: looza
I am trying to read in a string from the command line, copy it to another and then print it out character by character in the following code. I get a segfault when I use 'exp[i]'. Any ideas why, and...
That helps, Thank you so much!
#include<stdio.h>
int main()
{ int num[3]; /*Sets array to 3*/
int count;
char c;
printf("Enter a 3 numbered integer:");
for(count=0; count<3; count++){ ...
Hello,
I have an input file that has 3 columns. The first column includes alphanum special characters and spaces as well. It looks like this:
@ED#@ 11 AAA
!@ R$ 22 BBB
!@EDF 33...
Thanks Quzah,
This code segfaults :-(
typedef struct mystruct{
char mychar [5][4];
Hi All,
The following code prints out values of a 2 D array in main as well as in the function printvalues. However, fd->mychar[i] = newptr[i]; throws an error. I understand that a ** myarray is...
Hello all!
I am getting started with MPI and I was trying to use MPI-Bcast to broadcast a structure to all the other processes from process 0. Obviously, it doesnt seem to work as expected. I dont...
Because I can have several hosts and I need to identify requests coming from each of them, so every request will have a unique id, based on what host it is coming from. This unique id will be used to...
Hey All,
I need to convert a string (hostname) to an unique integer, much like how inet_addr(ip) converts the ip address to an integer.
I was looking at some related posts and I am sure there...
Aargh!! ok. Thanks! :-) Remote media is cool!
Thanks for your help tater. I guess it would help to provide more details and the oversimplification of the problem description was a bad idea, apologies.
Here is what really happens.
in...
Thanks Tater, though with this, I cannot access the updated value from outside main in anotherfunction().
I now have:
typedef struct mystruct{
int a;
.........
}mystruct_t;
Well thats how I started but I need to access the value of the element 'a' in subsequent functions as well, and hence * newstruct. If its not a pointer, the value is lost outside main. Isnt that how...
Hey All,
I have a struct like so:
typedef struct mystruct{
int a;
.........
}mystruct_t;
Thanks!
It works when I remove the O_DIRECT flag, but I need to use it, isnt there a way to use it with the flags?
The reason to use open/read and not fopen and fread is that I need to use...
I have the following code to randomly seek inside a file and read (or write) that location. When I try to execute it for a 32 mb (1<<25) file using: ./a.out /dev/sda3 25, it gives the error: Error in...