15,539 Topics
|
|
Hello, i have to create a program for- If the age is less than 18-You are still a kid 18-30 adult 30-60 middle age greater than 60-senior citizen else for any other impossible age (-ve or 0 age) ' wow ' Here is my attempt, [CODE]#include <stdio.h> #include <conio.h> void … |
|
Hi, I want to solve a problem( to be honest its my homework ) given two string, the print the permutation in ordered form. Example: Please enter the first string:> abc Please enter the second string:> mn Results will be: abcmn abmnc amnbc mnabc mabcn manbc mabnc ambnc ambcn abmcn … |
|
I wrote a program that takes in this kind of input: [CODE]Short, Sue, , 3.11 Cisneros, Juan, G, 3.67 Andrew, T, 5.67 Superlonglastnamethatdoesnotfit, Betty, Boop, 2 Black, Shirley, T, 4.00[/CODE] and my program outputs this: [CODE]Highest gpa: 4.00 Average gpa: 3.19 Lowest gpa: 2.00 Sue Short 3.11 Juan G. Cisneros … |
|
I have a text file with 500000 records , each record contain student ID and another index number. i insert this recors with separate function ,and i want when the user enter the student id the program get the corsponding index number and put it in avariable and use it … |
|
hi, this is something i keep running into. for example, in the following example of strtok, i'm splitting a given string on a space(" ") delimiter: [code] #include<stdio.h> #include<string.h> int main() { char str[]="1234563 34 7898"; char delim[]=" "; char* result=NULL; char new[15][3]; int i=0; int j=0; bzero(new, sizeof new); … |
|
I'm writing this program where I have to dynamically allocate memory. So I created a function that mallocs space and does a few other things. When I try to manipulate later outside the function, I get a segfault. How do I make sure that space that I malloc inside of … |
|
Hello Daniweb, Could anyone please point me to an example implementation of a dynamic memory allocator that uses Segregated Fits with allocations from the front and insertions at the end? I've been trying to figure out a way to implement one, but I just don't know where to start. |
|
Hi, So essentially I want to read every string in a file, then read every character in that string, find out if the string has two periods somewhere in it, and then save that string somewhere. Can someone get me started in the right direction? |
|
Hi all, Im creating a virtual collections program at the moment, and have added a 'contextual information' panel which fades in on a button click, and then fades out when clicked a second time. Simple enough. Here's the code: [CODE] GLfloat alpha; BOOL Press[256]; GLuint GUIselect; BOOL objectInfo; BOOL scene; … |
|
hi i would like u to tell me if i can make a random function to choose between four numbers and only them(-1 , 1 , -10 ,10) |
|
Hi everyone, I'm trying to accomplish the following; I need to create 2 subprocesses and each subprocess should create a process of their own. Should look like this: [QUOTE]I'm child xxxx parent xxxx I'm the subchild xxxx parent xxxx I'm the second child xxxx parent xxxx I'm the second subchild … |
|
Hi, i am trying to read the contents of a text file containing a single line into a string. i'm doing this in a while loop. the text file gets updated in each run of the loop and therefore the string should contain a new value in each run. but … |
|
Hey everyone, I'm trying to get this code to work... [CODE]#include <stdlib.h> #include <stdio.h> #include <stdbool.h> int allPrimes(int n) { int kiloN = n*1000; int count = 0; int i; for(i = 2; i <= kiloN; i++) { boolean hasfactor = false; int j = 2; while(j<i and !hasfactor) { … |
|
Ok, guys I know that I'm asking too much questions, it's just that I really want to understand how things work. So I have a little project: Make a program in C which runs three processes (A,B,C), which use a common memory (buffer). Process A generates 50 random numbers and … |
|
I was debugging a program and following is the snapshot: [CODE]81 while (j < len_y && suf_arr[j].word[0] == c) (gdb) 184 if (suf_arr[j].len > 1) (gdb) n 186 memcpy(temp_str, suf_arr[j].word+1, suf_arr[j].len-1); (gdb) n 187 ind = search(suf_arr, temp_str, len_y); (gdb) print suf_arr[j].word $13 = 0x7fffffff96d2 "bbit" (gdb) print suf_arr[j].word+1 $14 … |
|
[code]#include<stdio.h> #include<stdlib.h> main(){ char *tab; int n; int i; char c; printf("dimension du tableau?"); scanf("%d",&n); tab=(char*)malloc(n*sizeof(char)); printf("remplir le tableau :"); fflush(stdin); gets(tab); for(i=0;tab[i]!='\0';i++){ printf("%c",tab[i]); } }[/code] let's say i just want 5 letters in tab,so i run the program and put n=5,but what i don't get is that if i … |
|
[code]#include<stdio.h> #include<stdlib.h> #include<string.h> struct name { int a; char b[10]; char c; }; int main() { struct name *p; p = (struct name *)malloc(3 * sizeof(struct name)); char *n; n = "12345"; n = (char *)p; n = (int*)n; /*this is not correct . in doubt....change correctly*/ strcpy(n+(sizeof(p->a)),"ALL"); *(n+sizeof(p->a)+sizeof(p->b)) = … |
|
The aim of the program is to add ten numbers then output their sum. I can do this but in a very basic way. for instance the only way I know how to do this is by adding each array and thats quite tedious and long is there any way … |
|
I've been developing console applications using C/C++. I now want to move on and create some GUI applications. For that i saw some libraries to create GUI. I think those libraries are OS dependent. How can we create GUI applications compatible with Linux, Windows and Mac, or is it even … |
|
{ int i = 25789; char *p; .............. .............. printf("%d",*p); /* (*p) should give in printf*/ } dont assign p=i ............apart from this how we can typecast this program so that we can get interger value tp pointer p.............please help me this |
|
i would like to know how i mean when i scan image how it is transfer to computer in basic .aslo can i know the code scan file or image. |
|
Hi everyone! So can someone explain me how to compile a file with gcc? I'm using kubuntu, and I've written my source code in Kate(the text editor), and I saved it in documents like file1, and now how to compile it from the terminal? I've tried with the command: [code] … |
|
I'm trying to make a program,it's almost done... but i'm stuck on an error message that I get. I would appreciate any help. The error message: [QUOTE]error: conflicting types for ‘findEntry’ note: previous implicit declaration of ‘findEntry’...LINE 15[/QUOTE] I get it for this code: [CODE] catalogPointer findEntry(catalogPointer head, char names[]) … |
|
hey guys i'm new to c and still learning.need some help here. i wrote this code and it isn't work properly,unable to figure out whats wrong!!but when the [B]strget()[/B] call from the main() its working.please some help... [CODE]main() { int x; printf("enter a value :"); scanf("%d",&x); switch(x) { case 1: … |
|
|
|
Hi, How to implement a stack using two queues ? Help pls! Regards, Preethi |
|
[code]#include<stdio.h> #include<stdlib.h> #include<string.h> struct name { int *a; char b[10]; char c; }; int main() { struct name *p; p = ( struct name * ) malloc ( 3 * sizeof ( struct name ) ); char *n; n = ( char * ) p; *n = 275; strcpy ( … |
The End.