473,320 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

invalid indirection

Expand|Select|Wrap|Line Numbers
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <conio.h>
  4. #include <stdlib.h>
  5. int main()
  6. {
  7.    int count,i,j,k;
  8.    float u1,t1,u2,t2,u3,t3,u4,t4,u5,t5,u6,t6,u7,t7,u9,t9,p,p1,p2,p3,p4,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,F14,F15,F16,a[4],max,b[9],maximum;
  9.    clrscr();
  10.    unsigned seed;
  11.    printf("Enter the value of seed:");
  12.    scanf("%f",seed);
  13.    srand(seed);
  14.        for(u1=0;u1<10000000;u1++)
  15.        scanf("%4f",rand()/32768);
  16.        t1=3*u1+4;
  17.          for(u2=0;u2<10000000;u2++)
  18.          scanf("%4f",rand()/32768);
  19.          if(0=<u2)&&(u2<=0.333)
  20.          t2=4+sqrt(3*u2);
  21.      else
  22.      if(0.333=<u2)&&(u2<=1)
  23.          t2=7-sqrt(6-6*u2);
  24.            for(u3=0;u3<10000000;u3++)
  25.            scanf("%4f",rand()/32768); 
  26.            t3=-2.3025*log(1-u3)/0.2;
  27.              for(u4=0;u4<10000000;u4++)
  28.              scanf("%4f",rand()/32768);
  29.              t4=3*u4+4;
  30.                for(u5=0;u5<10000000;u5++)
  31.                scanf("%4f",rand()/32768);
  32.                if(0=<u5)&&(u5<=0.333)
  33.                t5=4+sqrt(3*u5);
  34.            else
  35.            if(0.333=<u5)&&(u5<=1)
  36.                t5=7-sqrt(6-6*u5);
  37.                  for(u6=0;u6<10000000;u6++)
  38.                  scanf("%4f",rand()/32768);
  39.                  t6=-2.3025*log(1-u6)/0.2;
  40.                    for(u7=0;u7<10000000;u7++)
  41.                    scanf("%4f",rand()/32768);
  42.                    t7=3*u7+4;
  43.                      for(u8=0;u8<10000000;u8++)
  44.                      scanf("%4f",rand()/32768);
  45.                      if(0=<u8)&&(u8<=0.333)
  46.                      t8=4+sqrt(3*u8);
  47.                  else
  48.                  if(0.333=<u8)&&(u8<=1)
  49.                      t8=7-sqrt(6-6*u8);
  50.                        for(u9=0;u9<10000000;u9++)
  51.                        scanf("%4f",rand()/32768);
  52.                        t9=-2.3025*log(1-u9)/0.2;
  53.    p1=t1+t4+t8;
  54.    p2=t2+t5+t8;
  55.    p3=t2+t6+t7+t8;
  56.    p4=t2+t6+t9;
  57.    printf("\n p1 is:%3f,p2 is:%3f,p3 is:%3f,p4 is:%3f,p1,p2,p3,p4);
  58.       count=0;
  59.       for(i=0;i<4;i++)
  60.       scanf(p[i]);
  61.       count++;
  62.       scanf("%3d",count);
  63.       printf("\n [count]<=15");
  64.       scanf("%3f",count);
  65.         F1=count/10000000;
  66.           scanf("%3f",F1);
  67.           printf("\n [count]<=16");
  68.           scanf("%3d",count);
  69.             F2=count/10000000;
  70.             scanf("%3f",F2);
  71.             printf("\n [count]<=17");
  72.             scanf("%3d",count);
  73.               F3=count/10000000;
  74.               scanf("%3f",F3);
  75.               printf("\n [count]<=18");
  76.               scanf("%3d",count);
  77.                 F4=count/10000000;
  78.                  scanf("%3f",F4);
  79.                  printf("\n [count]<=19");
  80.                  scanf("%3d",count);
  81.                    F5=count/10000000;
  82.                    scanf("%3f",F5);
  83.                    printf("\n [count]<=20");
  84.                    scanf("%3d",count);
  85.                      F6=count/10000000;
  86.                      scanf("%3f",F6);
  87.                      printf("\n [count]<=21");
  88.                      scanf("%3d",count);
  89.                        F7=count/10000000;
  90.                        scanf("%3d",F7);
  91.                        printf("\n [count]<=22");
  92.                        scanf("%3d",count);
  93.                          F8=count/10000000;
  94.                          scanf("%3f",F8);
  95.                          printf("\n [count]<=23");
  96.                          scanf("%3d",count);
  97.                            F9=count/10000000;
  98.                            scanf("%3f",F9);
  99.                            printf("\n [count]<=24");
  100.                            scanf("%3d",count);
  101.                              F10=count/10000000;
  102.                              scanf("%3f",F10);
  103.                              printf("\n [count]<=25");
  104.                              scanf("%3d",count);
  105.                                F11=count/10000000;
  106.                                scanf("%3f",F11);
  107.                                printf("\n [count]<=26");
  108.                                scanf("%3d",count);
  109.                                  F12=count/10000000;
  110.                                  scanf("%3f",F12);
  111.                                  printf("\n [count]<=27");
  112.                                  scanf("%3d",count);
  113.                                    F13=count/10000000;
  114.                                    scanf("%3f",F13);
  115.                                    printf("\n [count]<=28");
  116.                                    scanf("%3d",count);
  117.                                      F14=count/10000000;
  118.                                      scanf("%3f",F14);
  119.                                      printf("\n [count]<=29");
  120.                                      scanf("%3d",count);
  121.                                        F15=count/10000000;
  122.                                        scanf("%3d",F15);
  123.                                        printf("\n [count]<=30");
  124.                                        scanf("%3d",count);
  125.                                          F16=count/10000000;
  126.                                          scanf("%3f",F16);
  127.             count=0
  128.             for(j=0;j<4;j++)
  129.             scanf(p[j]);
  130.             count++;
  131.             scanf("%3d",count);
  132.             for(p=0;p<4;p++)
  133.             scanf("\n%3f",a[p]);
  134.             max=a[0];
  135.             for(p=1;p<4;p++)
  136.             {if(a[p]>max)
  137.             {max=a[p];}}
  138.             printf("The greatest path is: %f",max);
  139.                      count=0;
  140.                      for(k=0;k<9;k++)
  141.                      scanf(t[k]);
  142.                      count++;
  143.                      scanf("%3d",count);
  144.                      for(t=0;t<9;t++)
  145.                      scanf("\n%3f",b[t]);
  146.                      maximum=b[0];
  147.                      for(t=1;t<9;t++)
  148.                      {if(b[t]>max)
  149.                      {maximum=b[t];}}
  150.                      printf("The greatest activity is: %f",maximum);
  151.  
  152.        getch();
  153. return 0;
  154. }
May 15 '14 #1
1 8014
weaknessforcats
9,208 Expert Mod 8TB
Invalid indirection means you are using a variable where you should be using the address of the variable.

Check out your scanf calls.

Please use code tags.
May 15 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: robin.pain | last post by:
I was looking for GBS's phonetic dictionary when I came across an American who was having problems with it... of course, it can never work for... Geordies, Irish, Brummies, Strynes, South ifrrikuns...
5
by: Nobody | last post by:
excuse the "windows" code below, but this is a C++ question... or maybe a C. Anyways, I want a function where I can pass in an array of strings (variable count, variable size), so I defined this:...
10
by: blimeyoreilly | last post by:
Hi I've a small problem .. can anyone figure it out? I am working in VS.NET in C++ with MFC. I have a CWinApp-based class called CTestHarnessApp. I keep getting the 'differs in levels of...
5
by: spoilsport | last post by:
Ive got to write a multi-function program and I'm plugging in the functions but I keep getting this error from line 40. Im new to this and cant find an answer anywhere. Sam #include...
9
by: Roman Mashak | last post by:
Hello, All! I assume my post isn't offtopic here. I used 'valgrind' utility (guess plenty if you know and use it) for my application and I got the message "Invalid read of size 1" regarding...
19
by: santosh | last post by:
Hi all, In the following program I allocate a block of pointers to type char, initialised to zero. I then point each of those pointers to a block of allocated memory of fixed size (33 bytes). A...
5
by: Marty | last post by:
I am wondering what is the difference in the placement between the 2 uses of the indirection operator? Or is there a difference? AcDbBlockTable *pBlockTable = NULL; AcDbDatabase* pDB =...
6
by: Angus | last post by:
I am using a global which is a void* I have it defined in one file as: void* hFlag; and one other header file as: extern void* hFlag; But I get this compile error:
9
by: william | last post by:
When implementing Linked list, stack, or trees, we always use pointers to 'link' the nodes. And every node is always defined as: struct node { type data; //data this node contains ... node *...
3
by: imaloner | last post by:
I am posting two threads because I have two different problems, but both have the same background information. Common Background Information: I am trying to rebuild code for a working,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.