15,540 Topics

Member Avatar for
Member Avatar for COKEDUDE

What does this printf do? Not familiar with the question mark, colon, and extra NULL at the end. printf("%s ", row[i] ? row[i] : "NULL");

Member Avatar for hericles
0
174
Member Avatar for 小名

I can't slove this problem my code print nothing what's wrong with it ?? #include <stdio.h> #include <string.h> #include <ctype.h> #define total 1000 int weight (char word[total]) { int i; int sum; for (i=0;word[i]!='\0';i++) { sum+=i; } return sum; } char *getword (char temp[total]) { static char max[total]={'\0'}; int lenth,maxlenth; …

Member Avatar for 小名
0
1K
Member Avatar for COKEDUDE
Member Avatar for rproffitt
0
1K
Member Avatar for ajit.nayak

I am using Mplab x Ide with v3.61 on Xc8 compiler, PIC18F24K40. I used MCC generated UART code for send and receive data. For understanding I am clubling my code and posting part of it. My main code look like this #include "mcc_generated_files/mcc.h" #define EUSART_TX_BUFFER_SIZE 8 #define EUSART_RX_BUFFER_SIZE 8 /** …

Member Avatar for itnavigate
0
3K
Member Avatar for victoria_5

i made a property tax program but now i have to use it with pointers. i have to use 3 functions inputtotalsales,calculatetaxes,and displaytaxes.It was easy for me to do this the regular way but im having an issue with pointers . im getting errors saying redeclaration of statetax and countytax …

Member Avatar for tinstaafl
0
360
Member Avatar for subha_2
Member Avatar for Sooraj_2
Member Avatar for JamesCherrill
0
158
Member Avatar for Mooyeon

My program find the amount of specific word such as "whale" and "thee", but ignore "thee,", "whale....", and so on. How can I contain them? #include<stdio.h> #include<string.h> #include<ctype.h> int main(){ FILE *md,*out; char CHA[255]; char cha[255]; cha[255]=tolower(CHA[255]); char thee[]="thee"; char chapter[]="chapter"; char whale[]="whale"; char meet[]="meet"; int th=0; int ch=0; int …

Member Avatar for ruediger.bayer
0
383
Member Avatar for COKEDUDE

How would I split this big if statement across multiple lines? It works perfectly on one line. if (mysql_query(con, "CREATE TABLE Matches(match_id INT UNSIGNED PRIMARY KEY, date DATETIME NOT NULL, tournament INT UNSIGNED, playerA INT UNSIGNED, playerB INT UNSIGNED, scoreA INT UNSIGNED, scoreB INT UNSIGNED, offline bool)")) { finish_with_error(con); } …

Member Avatar for AndrisP
0
264
Member Avatar for COKEDUDE

This is what I came up with for reading a csv file with multiple types. It seems to get the job done in all cases but 1,2,,"a". Where there is a blank space. Can I please have some ideas on how to fix this? const char* getfield(char* line, int num) …

Member Avatar for COKEDUDE
0
328
Member Avatar for COKEDUDE

I keep getting this message. undefined reference to `mysql_get_client_info' From what I can figure out when I google it I am not linking correctly. So I tried this. gcc *.c -L"C:\Program Files\MySQL\MySQL Server 5.7\lib" Can I please get some help on what I am doing wrong?

Member Avatar for rproffitt
0
171
Member Avatar for Mooyeon

I wrote the code that using txt file, but error "0 [main] assignment4 16012 cygwin_exception::open_stackdumpfile: Dumping stack trace to assignment4.exe.stackdump" is only thing that printed to console. Here is my code. #include <stdio.h> int main() { FILE *fp; char buff[255]; fp = fopen("moby_dick.txt", "r"); printf("%c\n", fgetc(fp)); fscanf(fp, "%s", buff); printf("1 …

Member Avatar for rproffitt
0
226
Member Avatar for Lennac

So, I'm relatively new to programming and I'm working on a program that allows for input of grades, course hours, and then calculates GPA based on that. But, I'm going step by step, the first thing I'm trying to do is ensure that I can input the data so that …

Member Avatar for Lennac
0
338
Member Avatar for COKEDUDE

Are there any good tutorials c programming with mysql? I only found one promising link, unfortunately they neglect to to show what is in their header files which doesn't help very much. http://zetcode.com/db/mysqlc/

Member Avatar for rproffitt
0
403
Member Avatar for Vikrant_3

typedef struct{ int*p; }new; void main(){ new *buffptr=malloc(sizeof(new)); buffptr->p; } my doubt is the above declaration in main function accesses the value of p and not the address of p. If I want to increment the address of p what should I do?

Member Avatar for rubberman
0
145
Member Avatar for MUHAMMAD AHMAD_1

Write a C++ program that takes in text from the user and prints the total Number of spaces used in the text. Kindly, use #include<iostream> and #include<conio.h> only. while loop is more preferable than for or do-while.

Member Avatar for Reverend Jim
0
345
Member Avatar for Mooyeon

I made first board, but when I use function next_generation, it prints wrong result. For example, since first board is 01000 00100 11100 00000 00000, next one should be 00000 10100 01100 01000 00000 . But my program prints 00000 00100 01100 00000 00000. Here is my code. #include <stdio.h> …

Member Avatar for JamesCherrill
0
361
Member Avatar for Steve_37

gerard4143 explained 6 years ago how to store binary code in memory and then execute it. See https://www.daniweb.com/programming/software-development/threads/353077/store-binary-code-in-memory-then-execute-it#post1500738. In the example, we create an array of unsigned char containing these values: 0x50,0x57,0x56,0x52,0xe8, 0x00,0x00,0x00,0x00,0x5e, 0x48,0x81,0xc6,0x24,0x00, 0x00,0x00,0x48,0xc7,0xc0, 0x01,0x00,0x00,0x00,0x48, 0xc7,0xc7,0x01,0x00,0x00, 0x00,0x48,0xc7,0xc2,0x0e, 0x00,0x00,0x00,0x0f,0x05, 0x5a,0x5e,0x5f,0x5a,0xc3, 0x48,0x65,0x6c,0x6c,0x6f, 0x2c,0x20,0x57,0x6f,0x72, 0x6c,0x64,0x21,0x0a,0x00 This works fine when I use the …

Member Avatar for rproffitt
0
344
Member Avatar for victoria_5

I am making a bank program with functions.1 called displaymenu that produces a menu d(make deposit),w(make withdraw),b(check balance) and q(quit).2nd function is getdeposit which accepts balance as parameter and asks user for amount they want to deposit then add amount to balance and return it to main function.3rd getwithdrawal same …

Member Avatar for Reverend Jim
0
596
Member Avatar for Robert_66

Hi, I'm trying to make a program that sets up the hight dpi compatibility mode programatically on Windows 10, so that I don't have to set up manually the properties of every legacy *.exe program I use, there are hundreds. When you set up that on a local drive, Windows …

Member Avatar for rproffitt
0
1K
Member Avatar for Chris_45

So i'm in the process of learning about functions and I'm not grasping the full operation of them. I have a menu in which I have utilized a function but I want to create a fucntion for each of the menu options. I've heard of pointers but I haven't researched …

Member Avatar for Joris Claassen
0
374
Member Avatar for GURPREET_6

class space { public static void main(String args[]) { int i; for(i=0;i<5;i++) { System.out.print("*"); System.out.print("_"); } } for(i=0;i<5;i++) { System.out.println("*"); } }

Member Avatar for Joris Claassen
0
400
Member Avatar for Kerri_1

Hello i'm working on this piece of code and I have the idea how it should be. But I believe my assignment is base on boath C and shall formating command to create a menu. The code is working so far fine but in order to move on furthur. I …

Member Avatar for Joris Claassen
0
1K
Member Avatar for AndryGabry1
Member Avatar for Rahul47

Writing a function strreplace(s,chr,repl_chr) to replace the character 'chr' with character 'repl_chr' in a givne string s. I have done so far with following code. Getting awkward output. // Program to replace occurence of a character with another character in a string. #include<stdio.h> #include<conio.h> void strreplace(char *,char,char); int main() { …

Member Avatar for Reverend Jim
0
21K
Member Avatar for JohnMcPherson

Hello, I work at the U.S. Department of Labor. I am a maintenance prorgrammer of C code, and the configuration management of this code in the past has been very spotty. When I took over this project, a CM tool was in place I have been doing corret checkins and …

Member Avatar for JohnMcPherson
1
313
Member Avatar for Jon_12

Im having a hard time on how to display the total price when i choose roundtrip, on how to display the price and the total price.. someone please help me pls pls pls Here are the requirements: A. Log in by Username and password B. User can choose either one …

Member Avatar for jwenting
0
16K
Member Avatar for shadab96

Hi, I have written a code for Roman Numeral basic mathematical operation in C++. How to do unit testing for it/ How to write unit testing program for it? Here is the code: #include <iostream> #include <string> using namespace std; //Function to convert decimal number to roman string decimal_to_Roman(int number) …

Member Avatar for AssertNull
0
1K
Member Avatar for Ákos_1

I have learned C programming several years ago, but I would like to refresh my knowledge so looking for some material, which is perfect for this purpose. I have found ALISON courses and I am looking for similar solutions like this, where I can also take tests.

Member Avatar for sathish kumar_1
0
741
Member Avatar for kirtics34

Code Exercise – BIQ-001 Mr.X owns a small business in a region with poor law-and-order. Recently his warehouse has been plagued by thieves. Gangs of thieves raid over his warehouse from time to time, stealing his raw material, affecting his business. He has studied the occurrances and noticed it that …

Member Avatar for happygeek
0
10K

The End.