C/C++

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
Home » Tech Support »» C/C++
  • Global Array with size for input

    Hallo, i have to do a program with gsl library. I have to declare twoglobal array cos i can't pass them to gsl functions. The problem is thesize is an input from program. What can i do? I want to try it:/* Declaration global variables */ int elementi ; gsl_vector_complex*s_v= gsl_vector_com...

    1 answers | 574 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

  • break outside a loop and a switch

    Could someone tell me a beautiful way to exit from a switch and a loop in one statementwithout using a goto and if possible without using an auxiliary variable as i didint res;while (1){res = 0;if ((i = msgrcv (msqid, &rq_resa, SZ_MsgSrcResa, pid(), 0) == -1){aff_erreurs ("msgrcv", "Error when r...

    14 answers | 830 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

  • checking and verifying input line in a C program

    In a C program I am required to enter three numbers (integers) e.g. 2567 5 on execution of the program.C:\256 7 5There should be spaces between the three numbers and on pressing"enter", further processing is done. The problem requires me to checkwhether three numbers have actually been entered i...

    7 answers | 1186 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

  • Implementing

    Hi all !!I need to know that in C how to implement sizeof() without using thekeyword?The implementation should be generic.e.gmalloc(sizeof(struct));Here the sizeof() returns the number of bytes reserved and is areserved keyword which calls a function through the library function.But i want to im...

    6 answers | 506 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

  • help with string reverse

    I am trying to make a function to reverse a string. What I have rightnow ends in a segfault.#include <string.h>#include <stdio.h>/* Reverse a string */void strev(char *s){char tmp;int f = 0;int l = strlen(s) - 1;while (f < l){tmp = s[f];s[f] = s[l];s[l] = tmp;f++;l--;};return;}int...

    4 answers | 522 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

  • Problem with fopen

    I am writing a multithreaded web-server and multithreaded client in C.The server is required to keep a log of the transactions in a localfile. I try to open a file using the following:FILE *fd;fd = fopen("file.log","w");fprintf(fd, "%s\n",<a character string>);This is done a by a thread in...

    3 answers | 544 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

  • UNIX command prompt

    I'm writing a command prompt for unix and I've run into some problems:#include <stdio.h>#include <string.h>#include <unistd.h>#include <sys/types.h>#include <sys/wait.h>#include <stdlib.h>#define EXIT "exit"#define DELIMITER " "we are inint main(argc...

    5 answers | 2177 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

  • [H4 ***Hot stuff - check this out ! [H4

    ...

    0 answers | 19 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

  • Main loop helper functions

    Hello all,I've thought about having to implement 2 functions, sayenter_main_loop(func_name); and a function called quit_application();which terminates the program. The enter_main_loop() can be defined assomething like:int enter_main_loop(func_name){while(1){func_name();}return 0;}But then h...

    6 answers | 1024 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

  • Online programming challeges?

    Hi all,I am interested in knowing any periodic (montly/weekly) programmingchalleages held on internetDoes anybody know about such sites? Focusshould be on algorithm development and programming skills.For example, I found this ()butseems they have stopped it nowthanks in advance,pravink...

    14 answers | 341 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

  • More Solutions

    I was asked to submit atleast 5 solutions for the following problem:By Replacing/Adding or deleting only one character from the followingcode snippet, make it print tttttttttttttttttttt (20 times)#include<stdio.h>int main(){int k, j=20;for(k=0;k<j;k--)printf("t);printf("\n");return 0;}I...

    11 answers | 660 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

  • advantage of using typedefs

    I was looking at the source code of linux or open BSD. What I foundthat lots of typedefswere used. For example, consider the offset in a file. It was declaredasoff_t offset;and off_t is typedefed astypedef long off_t;I wanted to know what advantage do we get by typedefs ? Why we did notdeclareof...

    29 answers | 548 bytes | related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

SPONSORED
QUESTION
SPONSORED
EMSDN