15,552 Topics
| |
Hey everybody! I'm having a hard time finding a solution for my problem- I have a dynamic array that holds structs of Person type..now I want to delete one specific person so I need to move all the ppl after that person one block down in the array and then … | |
I am learning about code auditing, and I have a question relating to the argc/argv[] variables. I think that the argc is an integer type, so would enough command line arguments overflow the buffer? I know that it's a stretch, but I am looking for the third vulnerability in our … | |
Hello I'm trying to copy a character pointer into another character pointer. I currently have [CODE]static char *my_kstrdup(const char *buf) { char *ptr, *ret; ret = ptr = kmalloc(strlen(buf)); if(ptr = NULL) panic("kmalloc returned NULL"); for(; *buf != '\0'; ++ptr, ++buf) *ptr = *buf; *ptr = '\0'; return ret; }[/CODE] … | |
Why am I getting the wrong output? I have a feeling it has something to do with using type char vs. int....but im not specifically too sure. Please help! [CODE]1. blade71(130)% gcc -o vt visitype.c 2. blade71(131)% vt < vt.in > vt.out 3. blade71(132)% cat vt.out 4. The code 55 … | |
I'm writing a program that needs to use only the Unix system calls open, read and write to get and print data!The problem is that the program doesn't allow me to input the marital status of the first student! Am I missing something? Here is the code: [code] #include<stdio.h> #include … | |
hi Ive been working on a program that finds hidden files copies the contents and then deletes the hidden file so far ive got system("set OLDDIR=%CD%&&@ECHO OFF&&ECHO Finding Hidden Files&&dir /ah&&PAUSE"); printf("Please Choose The Files You Want To repair separated by spaces\n"); scanf("%c",&d1); getchar(); string cmd="echo"+d1; system(cmd.c_str()); but im having … | |
[code] #include <stdio.h> #include <conio.h> void *memset(void *dest,int value,int cnt); void *memset(void *dest,int val,int cnt) { void *start=dest; while(cnt--) { *((char *)dest)++=(char)val; } return start; } int main() { char arr[]={1,2,3,4}; memset(arr,0,4); printf("%s",arr); _getch(); return 0; } [/code] error : ++ need lvalue I know how to resolve this,but I … | |
Hi, I am new member of this forum, and i find it quite interesting. Here is my problem, i have some work for school that have to finish fast, and of course I google it, and found it here :) But there seem to be little problem, code that I've … | |
I am getting an error that says undeclared identifier. It is on the line if (answer[i][j] == ' '){ answer[a][j] = '*'; I have attached a good chunk of the code if you need more please let me know. Thanks. int main(void) { char answer [100][48]; int count; count= GetInput(answer); … | |
I receive the following error when I compile my code: [CODE]blade71(154)% gcc -o vt visitype.c Undefined first referenced symbol in file aVal /var/tmp//ccrbSM18.o ld: fatal: Symbol referencing errors. No output written to vt collect2: ld returned 1 exit status blade71(155)% cat visitype.c #include <stdio.h> #define MAX 1000 void aVal(char asciiname[], … | |
Please can somebody explain to me whether sometimes the strrev function fails or not. I was giving an assignment to write an application that can detect whether an entered word from the keyboard is a palindrome or not. After accepting the string and tried to use the function from the … | |
im not a little bit familiar with c program.....so can u help me to change this program to c program......pls ASAP.. here are the code: import java.awt.*; import java.awt.event.*; import java.net.*; import java.io.*; import javax.swing.*; public class TicTacToeServer extends JFrame { private byte board[]; private boolean xMove; private JTextArea output; … | |
i have to write a program where i input two positive integers (L and H) which are both less than 21. the program then prints out a box of solid asterisks wit L horizontal asterisks and H vertical asterisks. i dont really know where to start... can someone tell me? | |
Hello, I'm trying to implement a program in C to read and display data from a text file, assign certain values to pre-defined variables and continue reading in the data. And example format of the data file is: --------------------------------------------------------------------------------------------- *** General Comments *** .... ***... .... 5 125 3 .6167 … | |
[CODE]while(size!=0) { printf("loop start"); printf("File Size in int: %d \n",size); byte_count = recv(sock,recv_data, 1024,0); recv_data[byte_count] = '\0'; printf("hhahaha %d \n",10); printf("char is:%c \n",recv_data[0]); //fputc(recv_data[0], fpW); size=size-1; printf("loop end"); } fclose(fpW); This is a piece of Client side code .. i am sending data from Server Side but when i receive … | |
hi i need a help in a code.. Code requirement is:- FInd most occuring element in an array.. Say i have an array {1,2,4,4,4,5,1} answer should be 4..... Code should be in C language...... | |
Hi all, My program have two threads (parent thread & child thread). I want to set a high priority to my child thread when it is created. So I just follow the example given in the follow ([url]http://cs.pub.ro/~apc/2003/resources/pthreads/uguide/users-12.htm[/url]) ************************************************** [code=c] #define _MULTI_THREADED #include <pthread.h> #include <sched.h> #include <stdio.h> #include "check.h" … | |
Hello everyone, While implementing POSIX messaging queue, I am encountered with "Message too long error". I have stated 128 bits for my problem, but it still gives the same error. Please do help me in resolving this memory issue. Regards, Tapan. [code=c] #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <mqueue.h> … | |
Out of all the possible problems I though I may have in my program, this was not one of them. My menu code is looping twice before stopping for the fgets to take input.. so my menu options are getting printed twice? I have tried flushing the crap out of … | |
[CODE]#include<stdio.h> #include <stdlib.h> #define MAXLINE 10000 void reverse(char *str); int main() { int c, i; char j; char S[MAXLINE], *p1; p1=S; for(c=getchar(); c!=EOF; i++) { S[i]=c; } reverse(p1); return 0; } void reverse(char *str) { if(*str) { reverse(str+1); putchar(*str); } } [/CODE] Please help me correct the segmentation fault. [QUOTE]blade71(107)% … | |
Instructions: Trailing blanks and tabs are defined as blanks and tabs that precede a '\n' character or an EOF to terminate a line, without any intervening characters of other kinds. You should copy a getline() function of the kind you see in the text to read in lines from stdin … | |
A simple used car market Design and implement a used car market program.Store the following information for a car: a. ID (unique, can be used as the key) b. Brand c. Model d. Year of manufacturing e. Driven kms f. Price Valid operations are add/update/delete a car and search. User … | |
I have come across a strange behavior.. [CODE] #include <stdio.h> #include <conio.h> int strlen(const char *); int main() { char str[]="rahul"; printf("%d",strlen(str)); _getch(); return 0; } int strlen(const char *str) { const char *eostr=str; while(*eostr++); return eostr - str; } [/CODE] Outputs : In VS9 Length:6 // correct In gcc … | |
I've got a problem with this piece of iterating code: [CODE] /* Iterate to apparent position */ while (a1 != aT) { /* <-- assume a1 == aT here after the 3rd iteration */ a1 = aT; /* Recalculate position */ Venus_C(JDE - aT); /* Calculate */ ep = sqrt(pow(Venus_x(), … | |
hi guys, I am a new student in learning C, I have about a month of experience on it and i am learning now how to use loops. I wanted to write a program using loops in which i ask them to guess a password to a question i ask. … | |
I am working on a program in C right now that deals with linked lists. Here is the assignment statement: [INDENT]"Write a C program called Assignment4.c, that creates a linked list of Customer data. Each entry in the list is to have the customer’s last name, first name, id (int), … | |
Anyone got anything about reading a sequential number from text file per line and parsing it to an array in C? SequentialNumber.txt 12 3 45 6 7 8 3 5 6 7 7 0 -1 4 5 array1[] = {12, 3, 45, 6, 7, 8}; array2[] = {3, 5, 6, … | |
Could you check this C language Code... The Output is not complete... it doesnt print the firstclas name n id? my assignment is Write a complete C program that will meet the following requirement: • Create student detail must contain each student’s name (as a string), id (as integer) and … | |
This is the error I have been receiving when trying to compile my code: [QUOTE]blade71(45)% gcc -o trim trim.c Undefined first referenced symbol in file getline /var/tmp//ccYdyoM3.o ld: fatal: Symbol referencing errors. No output written to a.out collect2: ld returned 1 exit status [/QUOTE] My source is only a rough … | |
is there anyone who knows how to remove numbers and coma's from a text file |
The End.