Search Results

Search found 7401 results on 297 pages for 'gcc warning'.

Page 72/297 | < Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >

  • pointer and malloc [closed]

    - by gcc
    How many methods/ways are there taking input by using with pointer and dynamic memory? Input: 3 1 2 n k l 2 1 2 p 4 55 62 * # x (x is stop value, first input always integer) Example code: p=malloc(sizeof(int)); scanf("%d",&num_arrays); while(1) { scanf("%c",&(*(p+i))); if(*(p+i)=='x') break; ++i; } "3" is stored in num_arrays. The other input values are stored in pointer[array].

    Read the article

  • copy string one place to another

    - by gcc
    how can i copy part of the specific string to the another place example (aaa),(ddd),(fff),(fff),#p copy (ddd) to the side of the p (aaa),(fff),(fff),#p,(ddd) //before copyin add comma copy (fff) to side of the (ddd) (aaa),(fff),#p,(ddd),(fff) //string lenght always same

    Read the article

  • How can I put back a character that I've read when I detect it's the start of a new row?

    - by gcc
    char nm; int i=0; double thelow, theupp; double numbers[200]; for(i=0;i<4;++i) { { char nm; double thelow,theupp; /*after erased ,created again*/ scanf("%c %lf %lf", &nm, &thelow, &theupp); for (k = 0; ; ++k) ; { scanf("%lf",numbers[k]); if(numbers[k]=='\n') break; } /*calling function and sending data(nm,..) to it*/ } /*after } is seen (nm ..) is erased*/ ; } I want say compiler : hey my dear code read only i-th row,dont touch characters at placed in next line. because characters at placed in next line is token after i increased by 1 and nm ,thelow,theupp is being zero or erased after then again created. how can I do ? input; D -1.5 0.5 .012 .025 .05 .1 .1 .1 .025 .012 0 0 0 .012 .025 .1 .2 .1 .05 .039 .025 .025 B 1 3 .117 .058 .029 .015 .007 .007 .007 .015 .022 .029 .036 .044 .051 .058 .066 .073 .080 .088 .095 .103

    Read the article

  • taking and holding input

    - by gcc
    i tried to take input from user input like that input:: first line:>>name(white space)last name second line:>>identification number(white space)birtdate(,,:,,:) third line:>>lesson which he take (ce140 ce213 ce383...) last line:>>note he take(80 60 ......) this input type for each student i tried to hold this input in struct like struct name is first line { second line third line last line } my testing scanf("%[^\n]\n); take input hold in string scanf("%s",...secondline_name); storing in secondline_name . . . but this doesnot work are there any other way to hold input

    Read the article

  • dynamic memory allocation [closed]

    - by gcc
    i wanna write a program that creates (allocating memory) and manipulates (adding elements and increasing memory etc.) integer arrays dynamically according to given input sequences. input sequence which starts with the maximum number of arrays, includes integers to be put into arrays and some one letter characters which are commands to carry out some tasks (activating next array, deleting an array etc). also, i wanna create *c_arrays which is the address of the array whose elements are the actual capacities (How many integer slots are already allocated for an array?) of arrays how should i organize(set up) the algorithm?

    Read the article

  • make it simpler and efficient

    - by gcc
    temp1=*tutar[1]; //i hold input in char *tutar[] if(temp1!='x'||temp1!='n') arrays[1]=malloc(sizeof(int)*num_arrays); //if second input is int a=0; n=i; for(i=1;i<n;++i) { temp1=*tutar[i]; if(temp1=='d') { ++i; j=atoi(tutar[i]); free(arrays[j]); continue; } if(temp1=='x') break; if(temp1=='n')//if it is n { a=0; ++j; arrays[j]=malloc(sizeof(int)*num_arrays);//create and allocate continue; } ++a; if(a>num_arrays) //resize the array arrays[j]=realloc(arrays[j],sizeof(int)*(num_arrays+a)); *(arrays[j]+a-1)=atoi(tutar[i]); printf("%d",arrays[1][1]); } arrays is pointer when you see x exit you see n create (old one is new array[a] new one is array[i+1]) you see d delete arrays[i] according to int after d first number is size of max arrays and where is the error in code input is composed from int and n d x i make a program -taking input(first input must be int) -according to input(there is comman in input like n or d or j , i fill array with number and use memory efficiently -j is jumb to array[x] ( x is int coming after j in input)

    Read the article

  • realizing number ...how?? [closed]

    - by gcc
    i hold input like that A is char pointer A[0]=n A[1]=j A[2]=n A[3]=d . there is one number in A[] and every A[i] is important for me because what will i do in next step is determined by input in A[i] or A[n] A[j]=$ . A[i]=14(any number) . . int func(int temp) { if(temp=='n') ..do something then return 10; if(temp=='j') .. return 11; if(temp=='d') .. return 12; if(........) when temp find/realize number ,i wanna return 13; in if statement, what code should i write } how i can do }

    Read the article

  • p=malloc()!=null.......

    - by gcc
    char *p,*p1,*p2,*p3,*p4; for(;;) { if((p=malloc(10))!=NULL && (p1=malloc(20))!=NULL ......) break; } Writing if(........) is too boring and long, are there any ways to make it simpler?

    Read the article

  • expected identifier before ‘(’

    - by gcc
    stored_name_t scan_construct_struct(void) { stored_name_t stn; int i=0; scanf("%c %lf %lf",&(stn.name) ,&(stn.(the_lower_limit)) ,&(stn.(the_upper_limit))); for(i=0; (scanf("%s", stn.(numbers[i])))!=0; ++i) ; return stn; } dene.c:37: error: expected identifier before ‘(’ token and there is an one more error but I cannot see

    Read the article

  • make it simpliest

    - by gcc
    input 000 000 000 000 255 000 000 000 000 000 000 000 purpose instead of 000 write 0 and 255 write 2 take input { char A[800][600]; scanf("%d",&height); for(i=0;i<height;++i) scanf("%s",A[i]); then what output 0 0 0 0 2 0 0 0 0 0 0 0

    Read the article

  • (again) i improve my question [closed]

    - by gcc
    Possible Duplicate: realizing number …how?? i hold input like that A is char pointer A[0]=n A[1]=j A[2]=n // i take (one number)+special char(s)+command(s) (like $ or #) from user A[3]=d // the input order can be changed like char(s)+number+command . // there is one number in A[] . // and every A[i] is important for me because what will i do in next step . // is determined by that input in A[h] or A[n] . // example . // when you see $ go before array do something . // when you see number go farad equation and use it in there A[j]=$ // (number can be pozitif or negatif . A[i]=14(any number) . . int func(int temp) { if(temp=='n') //..do something then return 10; if(temp=='j') return 11; if(temp=='d') return 12; if(/*........*/) // when temp find/realize number ,i wanna return 13; // in if statement, (instead of .....) what code should i write } how i can do } NOTE::please ,dont close my question ,when you close icannot edit it

    Read the article

  • what wrong are there

    - by gcc
    int main(void) { char *tutar[100][20],temp; int i; int n; i=0; while(temp!='x') { scanf("%c",&temp); tutar[i]=malloc(sizeof(int)); tutar[i]=temp; ++i; } n =i; for(i=0;i<=n;++i) { printf(" %c ",*tutar[i]); } printf("\n\n"); /*for(i=0;i<=n;++i) { printf("%d",atoi(*tutar[i])); } */

    Read the article

  • Why can't I install psycopg2? (Python 2.6.4, PostgreSQL 8.4, OS X 10.6.3)

    - by cojadate
    UPDATE: After updating all my software, the error message has changed. Now, when I run "python setup.py install" I get the following: Warning: Unable to find 'pg_config' filebuilding 'psycopg2._psycopg' extension gcc-4.0 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.2.1 (dt dec ext pq3)" -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I. -c psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/psycopgmodule.o followed by a very long list of other error messages. After running python setup.py install I get the following: Warning: Unable to find 'pg_config' filebuilding 'psycopg2._psycopg' extension gcc-4.0 -arch ppc -arch i386 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 - DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.2.1 (dt dec ext pq3)" -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I. -c psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/psycopgmodule.o unable to execute gcc-4.0: No such file or directory error: command 'gcc-4.0' failed with exit status 1 There's probably something screamingly obvious there to anyone who knows the first thing about back-end web programming, but unfortunately it's all gobbledegook to me. The psycopg2 documentation was not helpful.

    Read the article

  • Install MySQLdb on a Mac

    - by Youcha
    I have Python 32 bits, I installed MySQL Community server 32 bits and I'm trying to install MySQLdb for Python. I run easy_install mysql-python and I have this error > easy_install mysql-python Searching for mysql-python Reading http://pypi.python.org/simple/mysql-python/ Reading http://sourceforge.net/projects/mysql-python/ Reading http://sourceforge.net/projects/mysql-python Best match: MySQL-python 1.2.4b5 Downloading http://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.4b5.zip#md5=4f645ed23ea0f8848be77f25ffe94ade Processing MySQL-python-1.2.4b5.zip Running MySQL-python-1.2.4b5/setup.py -q bdist_egg --dist-dir /var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5/egg-dist-tmp-GjLaFB Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz Extracting in /var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5/temp/tmpOVVY_R Now working in /var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5/temp/tmpOVVY_R/distribute-0.6.28 Building a Distribute egg in /private/var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5 /private/var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5/distribute-0.6.28-py2.6.egg unable to execute gcc-4.0: No such file or directory error: Setup script exited with error: command 'gcc-4.0' failed with exit status 1 Any idea on why gcc-4.0 cannot be found? I have Xcode and gcc 4.2.1 installed.

    Read the article

  • How can get dtrace to run the traced command with non-root priviledges ?

    - by Gyom
    OS X lacks linux's strace, but it has dtrace which is supposed to be so much better. However, I miss the ability to do simple tracing on individual commands. For example, on linux I can write strace -f gcc hello.c to caputre all system calls, which gives me the list of all the filenames needed by the compiler to compile my program (the excellent memoize script is built upon this trick) I want to port memoize on the mac, so I need some kind of strace. What I actually need is the list of files gcc reads and writes into, so what I need is more of a truss. Sure enough can I say dtruss -f gcc hello.c and get somewhat the same functionality, but then the compiler is run with root priviledges, which is obviously undesirable (apart from the massive security risk, one issue is that the a.out file is now owned by root :-) I then tried dtruss -f sudo -u myusername gcc hello.c, but this feels a bit wrong, and does not work anyway (I get no a.out file at all this time, not sure why) All that long story tries to motivate my original question: how do I get dtrace to run my command with normal user priviledges, just like strace does in linux ? Edit: is seems that I'm not the only one wondering how to do this: question #1204256 is pretty much the same as mine (and has the same suboptimal sudo answer :-)

    Read the article

  • C++ Switch won't compile with externally defined variable used as case

    - by C Nielsen
    I'm writing C++ using the MinGW GNU compiler and the problem occurs when I try to use an externally defined integer variable as a case in a switch statement. I get the following compiler error: "case label does not reduce to an integer constant". Because I've defined the integer variable as extern I believe that it should compile, does anyone know what the problem may be? Below is an example: test.cpp #include <iostream> #include "x_def.h" int main() { std::cout << "Main Entered" << std::endl; switch(0) { case test_int: std::cout << "Case X" << std::endl; break; default: std::cout << "Case Default" << std::endl; break; } return 0; } x_def.h extern const int test_int; x_def.cpp const int test_int = 0; This code will compile correctly on Visual C++ 2008. Furthermore a Montanan friend of mine checked the ISO C++ standard and it appears that any const-integer expression should work. Is this possibly a compiler bug or have I missed something obvious? Here's my compiler version information: Reading specs from C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/specs Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug Thread model: win32 gcc version 3.4.5 (mingw-vista special r3)

    Read the article

  • dynamic lib can't find static lib

    - by renyufei
    env: gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9) app: Bin(main) calls dynamic lib(testb.so), and testb.so contains a static lib(libtesta.a). file list: main.c test.h a.c b.c then compile as: gcc -o testa.o -c a.c ar -r libtesta.a testa.o gcc -shared -fPIC -o testb.so b.c gcc -o main main.c -L. -ltesta -ldl then compile success, but runs an error: ./main: symbol lookup error: ./testb.so: undefined symbol: print code as follows: test.h #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <dlfcn.h> int printa(const char *msg); int printb(const char *msg); a.c #include "test.h" int printa(const char *msg) { printf("\tin printa\n"); printf("\t%s\n", msg); } b.c #include "test.h" int printb(const char *msg) { printf("in printb\n"); printa("called by printb\n"); printf("%s\n", msg); } main.c #include "test.h" int main(int argc, char **argv) { void *handle; int (*dfn)(const char *); printf("before dlopen\n"); handle = dlopen("./testb.so", RTLD_LOCAL | RTLD_LAZY); printf("after dlopen\n"); if (handle == NULL) { printf("dlopen fail: [%d][%s][%s]\n", \ errno, strerror(errno), dlerror()); exit(EXIT_FAILURE); } printf("before dlsym\n"); dfn = dlsym(handle, "printb"); printf("after dlsym\n"); if (dfn == NULL) { printf("dlsym fail: [%d][%s][%s]\n", \ errno, strerror(errno), dlerror()); exit(EXIT_FAILURE); } printf("before dfn\n"); dfn("printb func\n"); printf("after dfn\n"); exit(EXIT_SUCCESS); }

    Read the article

  • Clarification of atomic memory access for different OSs

    - by murrekatt
    I'm currently porting a Windows C++ library to MacOS as a hobby project as a learning experience. I stumbled across some code using the Win Interlocked* functions and thus I've been trying to read up on the subject in general. Reading related questions here in SO, I understand there are different ways to do these operations depending on the OS. Interlocked* in Windows, OSAtomic* in MacOS and I also found that compilers have builtin (intrinsic) operations for this. After reading gcc builtin atomic memory access, I'm left wondering what is the difference between intrinsic and the OSAtomic* or Interlocked* ones? I mean, can I not choose between OSAtomic* or gcc builtin if I'm on MacOS when I use gcc? The same if I'd be on Windows using gcc. I also read that on Windows Interlocked* come as both inline and intrinsic versions. What to consider when choosing between intrinsic or inline? In general, are there multiple options on OSs what to use? Or is this again "it depends"? If so, what does it depend on? Thanks!

    Read the article

  • make arm architecture c library in mac

    - by gamegamelife
    I'm trying to make my own c library in Mac and include it to my iphone program. The c code is simple , like this: math.h: int myPow2(int); math.c: #include "math.h" int myPow2(int num) { return num*num; } I search how to make the c library file ( .a or .lib ..etc) seems need to use gcc compiler (Is there other methods?) so I use this command: gcc -c math.c -o math.o ar rcs libmath.a math.o And include it in iPhone Project. Now it has the problem when build xcode iphone project. "file was built for unsupported file format which is not the architecture being linked" I found some pages discuss about the problem, but no detail how to make the i386/arm architecture library. And I finally use this command to do it: gcc -arch i386 -c math.c -o math.o /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 -c math.c -o math.o I dont know if this method is correct? Or there has another method to do it?

    Read the article

  • Fix ACPI DSDT of Amilo Pa 1538

    - by kayahr
    I have a Fujitsu-Siemens Amilo Pa 1538 laptops and installed Ubuntu 10.04 on it (Kernel 2.6.32). Main problem is that the fans of the notebook are always on even when the temperature is low. Another problem is that the display brightness can not be adjusted. Since some years I use Dell laptops and never experienced any ACPI problems so I thought that it is no longer needed to fix ACPI tables but now I have this crap of a laptop and I think I have to do it. Unfortunately I need some help repairing the DSDT. The dsdt.dat and dsdt.dsl of the laptop can be found here: http://www.ailis.de/~k/permdata/20100420/dsdt/ Compiling the DSDT gives the following output: # iasl -sa dsdt.dsl Intel ACPI Component Architecture ASL Optimizing Compiler version 20090521 [Jun 30 2009] Copyright (C) 2000 - 2009 Intel Corporation Supports ACPI Specification Revision 3.0a dsdt.dsl 81: Method (\_WAK, 1, NotSerialized) Warning 1080 - ^ Reserved method must return a value (_WAK) dsdt.dsl 207: Method (_L10, 0, NotSerialized) Warning 1087 - ^ Not all control paths return a value (_L10) dsdt.dsl 2861: Method (NVIF, 3, NotSerialized) Warning 1087 - ^ Not all control paths return a value (NVIF) dsdt.dsl 4551: Store (\_SB.PCI0.LPC0.PMRD (0xFA), Local0) Warning 1099 - Statement is unreachable ^ ASL Input: dsdt.dsl - 4962 lines, 162828 bytes, 2300 keywords AML Output: dsdt.aml - 17627 bytes, 591 named objects, 1709 executable opcodes Compilation complete. 0 Errors, 4 Warnings, 0 Remarks, 519 Optimizations Anyone here with DSDT experience who can help me fixing the DSDT?

    Read the article

< Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >